Package org.apache.unomi.api
Class PropertyType
- java.lang.Object
-
- org.apache.unomi.api.Item
-
- org.apache.unomi.api.MetadataItem
-
- org.apache.unomi.api.PropertyType
-
- All Implemented Interfaces:
Serializable
public class PropertyType extends MetadataItem
A user-defined profile or session property, specifying how possible values are constrained, if the value is multi-valued (a vector of values as opposed to a scalar value).- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
ITEM_TYPE
The PropertyType ITEM_TYPE.-
Fields inherited from class org.apache.unomi.api.MetadataItem
metadata
-
-
Constructor Summary
Constructors Constructor Description PropertyType()
Instantiates a new Property type.PropertyType(Metadata metadata)
Instantiates a new Property type with the specified Metadata.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>
getAutomaticMappingsFrom()
Retrieves the set of JCR properties from which properties of this type would be automatically initialized from.Set<PropertyType>
getChildPropertyTypes()
List<DateRange>
getDateRanges()
Retrieves the date ranges.String
getDefaultValue()
Retrieves the default value defined for property using this PropertyType.List<IpRange>
getIpRanges()
Retrieves the ip ranges.String
getMergeStrategy()
Retrieves the identifier of thePropertyMergeStrategyType
to be used in case profiles with properties using this PropertyType are being merged.List<NumericRange>
getNumericRanges()
Retrieves the numeric ranges.Double
getRank()
Retrieves the rank of this PropertyType for ordering purpose.String
getTarget()
Retrieves the target for this property type, indicating the type of elements this property type is defined for.ValueType
getValueType()
Retrieves the value type associated with values defined for properties using this PropertyType.String
getValueTypeId()
Retrieves the identifier of the value type constraining values for properties using this PropertyType.Boolean
isMultivalued()
Whether properties using this property type are multi-valued.Boolean
isProtected()
Whether properties with this type are marked as protected.void
setAutomaticMappingsFrom(Set<String> automaticMappingsFrom)
Specifies the set of JCR properties from which properties of this type would be automatically initialized from.void
setChildPropertyTypes(Set<PropertyType> childPropertyTypes)
void
setDateRanges(List<DateRange> dateRanges)
Sets the date ranges.void
setDefaultValue(String defaultValue)
Sets the default value that properties using this PropertyType will use if no value is specified explicitly.void
setIpRanges(List<IpRange> ipRanges)
Sets the ip ranges.void
setMergeStrategy(String mergeStrategy)
Sets the identifier of thePropertyMergeStrategyType
to be used in case profiles with properties using this PropertyType are being mergedvoid
setMultivalued(Boolean multivalued)
Specifies whether properties using this property type are multi-valued.void
setNumericRanges(List<NumericRange> numericRanges)
Sets the numeric ranges.void
setProtected(boolean protekted)
Specifies whether properties with this type are marked as protected.void
setRank(Double rank)
Specifies the rank of this PropertyType for ordering purpose.void
setTarget(String target)
Sets the target for this property type.void
setValueType(ValueType valueType)
Sets the value type.void
setValueTypeId(String valueTypeId)
Sets the value type identifier.-
Methods inherited from class org.apache.unomi.api.MetadataItem
getMetadata, getScope, setMetadata
-
Methods inherited from class org.apache.unomi.api.Item
equals, getItemId, getItemType, getItemType, getSystemMetadata, getVersion, hashCode, setItemId, setItemType, setScope, setSystemMetadata, setVersion
-
-
-
-
Field Detail
-
ITEM_TYPE
public static final String ITEM_TYPE
The PropertyType ITEM_TYPE.
-
-
Constructor Detail
-
PropertyType
public PropertyType()
Instantiates a new Property type.
-
PropertyType
public PropertyType(Metadata metadata)
Instantiates a new Property type with the specified Metadata.- Parameters:
metadata
- the metadata associated with the specified metadata
-
-
Method Detail
-
getTarget
public String getTarget()
Retrieves the target for this property type, indicating the type of elements this property type is defined for. For example, for property types attached to profiles,target
would be"profiles"
. TODO: deprecated?- Returns:
- the target for this property type
-
setTarget
public void setTarget(String target)
Sets the target for this property type. TODO: deprecated?- Parameters:
target
- the target for this property type, indicating the type of elements this property type is defined for
-
getValueTypeId
public String getValueTypeId()
Retrieves the identifier of the value type constraining values for properties using this PropertyType.- Returns:
- the value type identifier associated with values defined by this PropertyType
- See Also:
ValueType
-
setValueTypeId
public void setValueTypeId(String valueTypeId)
Sets the value type identifier.- Parameters:
valueTypeId
- the value type identifier
-
getValueType
public ValueType getValueType()
Retrieves the value type associated with values defined for properties using this PropertyType.- Returns:
- the value type associated with values defined for properties using this PropertyType
-
setValueType
public void setValueType(ValueType valueType)
Sets the value type.- Parameters:
valueType
- the value type associated with values defined for properties using this PropertyType
-
getDefaultValue
public String getDefaultValue()
Retrieves the default value defined for property using this PropertyType.- Returns:
- the default value defined for property using this PropertyType
-
setDefaultValue
public void setDefaultValue(String defaultValue)
Sets the default value that properties using this PropertyType will use if no value is specified explicitly.- Parameters:
defaultValue
- the default value that properties using this PropertyType will use if no value is specified explicitly
-
getAutomaticMappingsFrom
public Set<String> getAutomaticMappingsFrom()
Retrieves the set of JCR properties from which properties of this type would be automatically initialized from. TODO: remove from API?- Returns:
- the name of JCR properties properties of this type would be automatically initialized from
-
setAutomaticMappingsFrom
public void setAutomaticMappingsFrom(Set<String> automaticMappingsFrom)
Specifies the set of JCR properties from which properties of this type would be automatically initialized from. TODO: remove from API?- Parameters:
automaticMappingsFrom
- the set of JCR properties from which properties of this type would be automatically initialized from
-
getRank
public Double getRank()
Retrieves the rank of this PropertyType for ordering purpose.- Returns:
- the rank of this PropertyType for ordering purpose
-
setRank
public void setRank(Double rank)
Specifies the rank of this PropertyType for ordering purpose.- Parameters:
rank
- the rank of this PropertyType for ordering purpose
-
getMergeStrategy
public String getMergeStrategy()
Retrieves the identifier of thePropertyMergeStrategyType
to be used in case profiles with properties using this PropertyType are being merged.- Returns:
- the identifier of the
PropertyMergeStrategyType
to be used in case profiles with properties using this PropertyType are being merged
-
setMergeStrategy
public void setMergeStrategy(String mergeStrategy)
Sets the identifier of thePropertyMergeStrategyType
to be used in case profiles with properties using this PropertyType are being merged- Parameters:
mergeStrategy
- the identifier of thePropertyMergeStrategyType
to be used in case profiles with properties using this PropertyType are being merged
-
getDateRanges
public List<DateRange> getDateRanges()
Retrieves the date ranges.- Returns:
- the date ranges
-
setDateRanges
public void setDateRanges(List<DateRange> dateRanges)
Sets the date ranges.- Parameters:
dateRanges
- the date ranges
-
getNumericRanges
public List<NumericRange> getNumericRanges()
Retrieves the numeric ranges.- Returns:
- the numeric ranges
-
setNumericRanges
public void setNumericRanges(List<NumericRange> numericRanges)
Sets the numeric ranges.- Parameters:
numericRanges
- the numeric ranges
-
setIpRanges
public void setIpRanges(List<IpRange> ipRanges)
Sets the ip ranges.- Parameters:
ipRanges
- the ip ranges
-
isMultivalued
public Boolean isMultivalued()
Whether properties using this property type are multi-valued.- Returns:
true
if properties of this type should be multi-valued,false
otherwise
-
setMultivalued
public void setMultivalued(Boolean multivalued)
Specifies whether properties using this property type are multi-valued.- Parameters:
multivalued
-true
if properties of this type should be multi-valued,false
otherwise
-
isProtected
public Boolean isProtected()
Whether properties with this type are marked as protected. Protected properties can be displayed but their value cannot be changed. TODO: rename to readOnly?- Returns:
true
if properties of this type are protected,false
otherwise
-
setProtected
public void setProtected(boolean protekted)
Specifies whether properties with this type are marked as protected.- Parameters:
protekted
-true
if properties of this type are protected,false
otherwise
-
getChildPropertyTypes
public Set<PropertyType> getChildPropertyTypes()
-
setChildPropertyTypes
public void setChildPropertyTypes(Set<PropertyType> childPropertyTypes)
-
-