Package com.day.cq.personalization
Class Segment
- java.lang.Object
-
- com.day.cq.personalization.Segment
-
public class Segment extends java.lang.Object
TheSegment
class is a server-side representation of a segment which may be assigned to a user.Since AEM segments are resolved client-side, this class makes a best-effort approach to represent the segments on the server side, but some precision may be lost. For instance, script segments will not have their scripts loaded by this segment, but will rather be referenced as
Segment.Kind.ClientOnly
segments.This class is intended to be used, but not extended by consumers.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Segment.Kind
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NAME_PERCENTILE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(Segment resolvedSegment)
java.util.List<Segment>
getChildren()
Segment.Kind
getKind()
java.lang.String
getName()
java.lang.String
getOperator()
java.util.List<java.lang.String>
getValue()
static Segment
newByPathSegment(java.lang.String path)
Creates a newClientOnly
segment instancestatic Segment
newDirectSegment(java.lang.String name, java.lang.String operator, java.lang.String value)
static Segment
newDirectSegment(java.lang.String name, java.lang.String operator, java.util.List<java.lang.String> values)
static Segment
newExternalReferenceSegment(java.lang.String name, java.lang.String operator, java.lang.String externalId)
static Segment
newLogicSegment(Segment.Kind kind)
java.lang.String
toString()
-
-
-
Field Detail
-
NAME_PERCENTILE
public static final java.lang.String NAME_PERCENTILE
- See Also:
- Constant Field Values
-
-
Method Detail
-
newLogicSegment
public static Segment newLogicSegment(Segment.Kind kind)
-
newDirectSegment
public static Segment newDirectSegment(java.lang.String name, java.lang.String operator, java.lang.String value)
-
newDirectSegment
public static Segment newDirectSegment(java.lang.String name, java.lang.String operator, java.util.List<java.lang.String> values)
-
newExternalReferenceSegment
public static Segment newExternalReferenceSegment(java.lang.String name, java.lang.String operator, java.lang.String externalId)
-
newByPathSegment
public static Segment newByPathSegment(java.lang.String path)
Creates a newClientOnly
segment instance- Parameters:
path
- the repository location of the segment- Returns:
- a new segment instance
-
getKind
public Segment.Kind getKind()
-
getName
public java.lang.String getName()
-
getOperator
public java.lang.String getOperator()
-
getValue
public java.util.List<java.lang.String> getValue()
-
getChildren
public java.util.List<Segment> getChildren()
-
addChild
public void addChild(Segment resolvedSegment)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-