Class 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 KKey instance by calling of(String).
    K-key instances are thread safe, immutable and cached. If you call of(String) for the same K-key multiple times, you will probably get the same instances of KKey (this behavior is not guaranteed).

    K-key also provides some metadata like 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 methods getDataType(), getConverter() etc.

    Author:
    Vlastimil Dolejs
    See Also:
    Serialized Form
    • Method Detail

      • of

        public static KKey of​(String key)
        Gets the instance of KKey for the given key. Returned instance may not be a new instance, but reused instance from cache.
        Parameters:
        key -
        Returns:
      • getLevel

        public KKey.Level getLevel()
        Returns KKey.Level of 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
      • isAnyPartLevel

        public boolean isAnyPartLevel()
        Returns:
        whether this key represents information for part (dil / teil) regardless whether it is custom or not
      • 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
      • isAnyCharacteristicLevel

        public boolean isAnyCharacteristicLevel()
        Returns:
        whether this key represents information for characterstic (znak / merkmal) regardless whether it is custom or not
      • 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
      • isAnyValueLevel

        public boolean isAnyValueLevel()
        Returns:
        whether this key represents information for value (hodnota / wertevar) regardless whether it is custom or not
      • 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
      • isCustomCatalogLevel

        public boolean isCustomCatalogLevel()
        Returns:
        whether this key represents information about catalog record and is defined as custom
      • isAnyCatalogLevel

        public boolean isAnyCatalogLevel()
        Returns:
        whether this key represents information about catalog record regardless whether it is custom or not
      • 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