Package cz.diribet.aqdef
Class KKey
- java.lang.Object
-
- cz.diribet.aqdef.KKey
-
- All Implemented Interfaces:
Serializable,Comparable<KKey>
public final class KKey extends Object implements Serializable, Comparable<KKey>
K-key (also referred to as 'Key field' / 'K field' in the documentation of AQDEF format)Represents single key in AQDEF format (e.g. K1001) and can be used to create AQDEF data structure (K-key : value pairs).
You can obtain
KKeyinstance by callingof(String).
K-key instances are thread safe, immutable and cached. If you callof(String)for the same K-key multiple times, you will probably get the same instances ofKKey(this behavior is not guaranteed).K-key also provides some
metadatalike datatype of the K-key. These can be retrieved like this:KKey kKey = KKey.of("K1001"); KKeyMetadata metadata = kKey.getMetadata();Or you can directly read metadata properties using delegate methodsgetDataType(),getConverter()etc.- Author:
- Vlastimil Dolejs
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classKKey.Level
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(KKey o)booleanequals(Object obj)IKKeyValueConverter<?>getConverter()Class<?>getDataType()StringgetDbColumnName()StringgetKey()KKey.LevelgetLevel()ReturnsKKey.Levelof the AQDEF structure this K-key belongs to.KKeyMetadatagetMetadata()Getsmetadataof this K-keyinthashCode()booleanisCatalogLevel()booleanisCharacteristicLevel()booleanisCustom()booleanisCustomCharacteristicLevel()booleanisCustomPartLevel()booleanisCustomValueLevel()booleanisGroupLevel()booleanisHierarchyLevel()booleanisPartLevel()booleanisRespectsCharacteristicDecimalSettings()booleanisSimpleHierarchyLevel()booleanisValueLevel()static KKeyof(String key)Gets the instance ofKKeyfor the givenkey.booleanshouldBeWrittenToDfq()StringtoString()
-
-
-
Method Detail
-
of
public static KKey of(String key)
Gets the instance ofKKeyfor the givenkey. Returned instance may not be a new instance, but reused instance from cache.- Parameters:
key-- Returns:
-
getKey
public String getKey()
-
getConverter
public IKKeyValueConverter<?> getConverter()
- Returns:
-
getDbColumnName
public String getDbColumnName()
- Returns:
-
getDataType
public Class<?> getDataType()
- Returns:
-
isRespectsCharacteristicDecimalSettings
public boolean isRespectsCharacteristicDecimalSettings()
- Returns:
-
getMetadata
public KKeyMetadata getMetadata()
Getsmetadataof this K-key- Returns:
-
getLevel
public KKey.Level getLevel()
ReturnsKKey.Levelof the AQDEF structure this K-key belongs to.- Returns:
-
isPartLevel
public boolean isPartLevel()
- Returns:
- whether this key represents information for part (dil / teil)
-
isCustomPartLevel
public boolean isCustomPartLevel()
- Returns:
- whether this key represents information for part (dil / teil) and is defined as custom
-
isCharacteristicLevel
public boolean isCharacteristicLevel()
- Returns:
- whether this key represents information for characterstic (znak / merkmal)
-
isCustomCharacteristicLevel
public boolean isCustomCharacteristicLevel()
- Returns:
- whether this key represents information for characterstic (znak / merkmal) and is defined as custom
-
isValueLevel
public boolean isValueLevel()
- Returns:
- whether this key represents information for value (hodnota / wertevar)
-
isCustomValueLevel
public boolean isCustomValueLevel()
- Returns:
- whether this key represents information for value (hodnota / wertevar) and is defined as custom
-
isGroupLevel
public boolean isGroupLevel()
- Returns:
- whether this key represents information about logical group
-
isHierarchyLevel
public boolean isHierarchyLevel()
- Returns:
- whether this key represents information about hierarchy
-
isSimpleHierarchyLevel
public boolean isSimpleHierarchyLevel()
- Returns:
- whether this key represents information about simple hierarchy
-
isCatalogLevel
public boolean isCatalogLevel()
- Returns:
- whether this key represents information about catalog record
-
isCustom
public boolean isCustom()
- Returns:
- whether this key represents our custom key
-
shouldBeWrittenToDfq
public boolean shouldBeWrittenToDfq()
- Returns:
- whether this k-key should be written to DFQ file
-
compareTo
public int compareTo(KKey o)
- Specified by:
compareToin interfaceComparable<KKey>
-
-