Package org.silverpeas.core.webapi.pdc
Class PdcAxisValueEntity
- java.lang.Object
-
- org.silverpeas.core.webapi.pdc.PdcValueEntity
-
- org.silverpeas.core.webapi.pdc.PdcAxisValueEntity
-
- All Implemented Interfaces:
Serializable
public class PdcAxisValueEntity extends PdcValueEntity
A value of a PdC's axis. A value of an axis is a term in the vocabulary of the concept represented by the axis, and it is related to the base value of the axis; It can be either a parent or a child of the axis base value. As the axis is a tree, its values can be refined by its branches. As such, the value can also be a part of an axis branch whose its level attribute indicates its position in the tree from the root.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PdcAxisValueEntity()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
static PdcAxisValueEntity
fromValue(Value value, String inLanguage)
Creates a new value of a PdC axis from the specified business PdC value and expressed in the specified language.int
getClassifiedContentsCount()
Gets the count of contents that are classified with this value.int
getLevel()
Gets the position level of this value in the semantic tree or 0. 0 means its level is at the axis.String
getTerm()
Gets the translated term represented by this value.int
hashCode()
boolean
isAscendant()
Is this value is ascendant from the axis origin ?boolean
isOrigin()
Is this value the origin of the axis?boolean
isRootValue()
Is this value is the root one of the axis?protected void
setAsAscendant()
Sets this axis value as ascendant to the axis origin value.protected void
setAsOriginValue()
Sets this axis value as the origin of the axis.String
toString()
-
Methods inherited from class org.silverpeas.core.webapi.pdc.PdcValueEntity
belongToATree, getAxisId, getId, getSynonyms, getTermId, getTreeId, setSynonyms, setTreeId
-
-
-
-
Method Detail
-
fromValue
public static PdcAxisValueEntity fromValue(Value value, String inLanguage)
Creates a new value of a PdC axis from the specified business PdC value and expressed in the specified language.- Parameters:
value
- the business PdC value.inLanguage
- the language of the user.- Returns:
- a PdcAxisValue instance.
-
getTerm
public String getTerm()
Gets the translated term represented by this value.- Returns:
- the term translated into the user language.
-
getLevel
public int getLevel()
Gets the position level of this value in the semantic tree or 0. 0 means its level is at the axis.- Returns:
- the position level or 0 if it doesn't belong to a tree.
-
isAscendant
public boolean isAscendant()
Is this value is ascendant from the axis origin ? When a PdC is parameterized for a given Silverpeas component instance, the origin of each axis can be refined. As such, values between the default and the new axis origin become ascendant to the latter.- Returns:
- true if this value is ascendant to the configured axis origin.
-
getClassifiedContentsCount
public int getClassifiedContentsCount()
Gets the count of contents that are classified with this value.- Returns:
- the count of contents classified with this value.
-
isRootValue
public boolean isRootValue()
Is this value is the root one of the axis? A value is the root of an axis when its identifier is equal to /0/ where 0 is the node identifier of the root in an axis.- Returns:
- true if this value is a root one, false otherwise.
-
isOrigin
public boolean isOrigin()
Is this value the origin of the axis?- Returns:
- true if this axis value is the origin of the axis, false otherwise.
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classPdcValueEntity
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classPdcValueEntity
-
setAsOriginValue
protected void setAsOriginValue()
Sets this axis value as the origin of the axis.
-
setAsAscendant
protected void setAsAscendant()
Sets this axis value as ascendant to the axis origin value.
-
-