src/main/java/cz/diribet/aqdef/model/builder/AqdefObjectModelBuilder.java
/**
	 * Replaces value of a given K-key with a new value for:
	 * <ul>
	 *   <li>single characteristic of a single part if both {@code partIndex} and {@code characteristicIndex} are provided</li>
	 *   <li>single characteristic of all parts if {@code partIndex = 0} and {@code characteristicIndex > 0}</li>
	 *   <li>all characteristics of single part if {@code partIndex > 0} and {@code characteristicIndex = 0}</li>
	 *   <li>all characteristics of all parts if {@code partIndex = 0} and {@code characteristicIndex = 0}</li>
	 * </ul>
	 * <p>
	 * If the K-key doesn't have value, it will be added.
	 * </p>
	 *
	 * @param key
	 * @param partIndex
	 * @param characteristicIndex
	 * @param value
	 */
Replaces value of a given K-key with a new value for:

single characteristic of a single part if both  partIndex and  characteristicIndex are provided
single characteristic of all parts if  partIndex = 0 and  characteristicIndex > 0
all characteristics of single part if  partIndex > 0 and  characteristicIndex = 0
all characteristics of all parts if  partIndex = 0 and  characteristicIndex = 0


If the K-key doesn't have value, it will be added.


Replaces value of a given K - key with a new value for : single characteristic of a single part if both partIndex and characteristicIndex are provided single characteristic of all parts if partIndex = 0 and characteristicIndex > 0 all characteristics of single part if partIndex > 0 and characteristicIndex = 0 all characteristics of all parts if partIndex = 0 and characteristicIndex = 0 If the K - key doesn ' t have value it will be added .
public void replaceCharacteristicEntry(String key, int partIndex, int characteristicIndex, Object value) {
		KKey kKey = KKey.of(key);
		List<PartIndex> affectedPartIndexes;
		if (partIndex == 0) {
			affectedPartIndexes = aqdefObjectModel.getPartIndexes();
		} else {
			affectedPartIndexes = Collections.singletonList(PartIndex.of(partIndex));
		}
		affectedPartIndexes.forEach(affectedPartIndex -> {
			List<CharacteristicIndex> affectedCharacteristicIndexes;
			if (characteristicIndex == 0) {
				affectedCharacteristicIndexes = aqdefObjectModel.getCharacteristicIndexes(affectedPartIndex);
			} else {
				affectedCharacteristicIndexes = Collections.singletonList(CharacteristicIndex.of(affectedPartIndex, characteristicIndex));
			}
			affectedCharacteristicIndexes.forEach(affectedCharacteristicIndex -> {
				aqdefObjectModel.putCharacteristicEntry(kKey, affectedCharacteristicIndex, value);
			});
		});
	}
public void replaceCharacteristicEntry ( String key , int partIndex , int characteristicIndex , Object value ) { KKey kKey = KKey . of ( key ) ; List < PartIndex > affectedPartIndexes ; if ( partIndex == 0 ) { affectedPartIndexes = aqdefObjectModel . getPartIndexes ( ) ; } else { affectedPartIndexes = Collections . singletonList ( PartIndex . of ( partIndex ) ) ; } affectedPartIndexes . forEach ( affectedPartIndex -> { List < CharacteristicIndex > affectedCharacteristicIndexes ; if ( characteristicIndex == 0 ) { affectedCharacteristicIndexes = aqdefObjectModel . getCharacteristicIndexes ( affectedPartIndex ) ; } else { affectedCharacteristicIndexes = Collections . singletonList ( CharacteristicIndex . of ( affectedPartIndex , characteristicIndex ) ) ; } affectedCharacteristicIndexes . forEach ( affectedCharacteristicIndex -> { aqdefObjectModel . putCharacteristicEntry ( kKey , affectedCharacteristicIndex , value ) ; } ) ; } ) ; }
Replaces value of a given K-key with a new value for:
 <ul>
   <li>single characteristic of a single part if both {@code partIndex} and {@code characteristicIndex} are provided</li>
   <li>single characteristic of all parts if {@code partIndex = 0} and {@code characteristicIndex > 0}</li>
   <li>all characteristics of single part if {@code partIndex > 0} and {@code characteristicIndex = 0}</li>
   <li>all characteristics of all parts if {@code partIndex = 0} and {@code characteristicIndex = 0}</li>
 </ul>
 <p>
 If the K-key doesn't have value, it will be added.
Replaces value of a given K - key with a new value for : <ul > <li > single characteristic of a single part if both { @code partIndex } and { @code characteristicIndex } are provided< / li > <li > single characteristic of all parts if { @code partIndex = 0 } and { @code characteristicIndex > 0 } < / li > <li > all characteristics of single part if { @code partIndex > 0 } and { @code characteristicIndex = 0 } < / li > <li > all characteristics of all parts if { @code partIndex = 0 } and { @code characteristicIndex = 0 } < / li > < / ul > <p > If the K - key doesn ' t have value it will be added .