Class PropertyKey
java.lang.Object
de.hybris.platform.integrationservices.util.files.PropertyKey
Represents a property key in a localization bundle file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringasAttributeProperty(String typeCode, String attributeName) Retrieves required property presentation for the specified item attribute.static StringasItemProperty(String typeCode) Retrieves required property presentation for the specified item type.booleanRetrieves name of the item type attribute localized by this property key.Retrieves item type, for which this property key is.@NotNull StringRetrieves the property key value as it appears in the localization properties file.inthashCode()booleanDetermines whether this property is for an item attribute localization.booleanDetermines whether this property is for an item type localization.booleanSome localization properties for types and attributes are optional.booleanisValid()Determines whether this key is valid in the context of an extension localization file.toString()
-
Constructor Details
-
PropertyKey
Instantiates this property key.- Parameters:
key- the full property key as it appears in the localization file, e.g."type.Product.name"
-
-
Method Details
-
getItemType
Retrieves item type, for which this property key is.- Returns:
- segment of the property key containing the item type name or
null, if this property is not for an item type localization.
-
getAttributeName
Retrieves name of the item type attribute localized by this property key.- Returns:
- segment of the property containing the attribute name or
null, if this property is not for an attribute localization
-
getKeyString
Retrieves the property key value as it appears in the localization properties file.- Returns:
- the string value of the key, e.g.
"type.IntegrationObject.name"
-
isItemType
public boolean isItemType()Determines whether this property is for an item type localization.- Returns:
true, if this property is in one of the following formats:type.<type_code>.nametype.<type_code>.description
falseotherwise.
-
isAttribute
public boolean isAttribute()Determines whether this property is for an item attribute localization.- Returns:
true, if this property is in one of the following formats:type.<type_code>.<attribute_name>.nametype.<type_code>.<attribute_name>.description
falseotherwise.
-
isValid
public boolean isValid()Determines whether this key is valid in the context of an extension localization file.- Returns:
true, if the property key is either for an item type or for an item type attribute.- See Also:
-
isRequired
public boolean isRequired()Some localization properties for types and attributes are optional. Only properties ending with".name"are required for localization purposes. This method determines whether this property key represents a required or an optional localization property.- Returns:
true, if this property is required to be present in a localization file;false, if it's optional.
-
asItemProperty
Retrieves required property presentation for the specified item type.- Parameters:
typeCode- a type code for an item to get the corresponding localization property for- Returns:
- localization property key as it would be returned by
getKeyString()method, if there was aPropertyKeyfor the specified item
-
asAttributeProperty
Retrieves required property presentation for the specified item attribute.- Parameters:
typeCode- type code of the item containing the specified attribute.attributeName- name of the attribute to get the corresponding localization property for- Returns:
- localization property key as it would be returned by
getKeyString()method, if there was aPropertyKeyfor the specified attribute.
-
hashCode
public int hashCode() -
equals
-
toString
-