Package org.onosproject.net.pi.runtime
Class PiActionProfileGroup.WeightedMember
- java.lang.Object
-
- org.onosproject.net.pi.runtime.PiActionProfileGroup.WeightedMember
-
- Enclosing class:
- PiActionProfileGroup
public static final class PiActionProfileGroup.WeightedMember extends Object
Weighted reference to an action profile member as used in an action profile group.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_WEIGHT
-
Constructor Summary
Constructors Constructor Description WeightedMember(PiActionProfileMemberId memberId, int weight)Creates a new reference for the given action profile member ID and weight.WeightedMember(PiActionProfileMember memberInstance, int weight)Creates a new reference from the given action profile member instance and weight.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)inthashCode()PiActionProfileMemberIdid()Returns the ID of the action profile member.PiActionProfileMemberinstance()If present, returns the instance of the action profile member pointed by this reference, otherwise returns null.StringtoString()intweight()Returns the weight of this group member.
-
-
-
Field Detail
-
DEFAULT_WEIGHT
public static final int DEFAULT_WEIGHT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WeightedMember
public WeightedMember(PiActionProfileMemberId memberId, int weight)
Creates a new reference for the given action profile member ID and weight.- Parameters:
memberId- action profile member IDweight- weight
-
WeightedMember
public WeightedMember(PiActionProfileMember memberInstance, int weight)
Creates a new reference from the given action profile member instance and weight. This constructor should be used when performing one-shot group programming (seeinstance()).- Parameters:
memberInstance- action profile member instanceweight- weight
-
-
Method Detail
-
id
public PiActionProfileMemberId id()
Returns the ID of the action profile member.- Returns:
- action profile member ID
-
weight
public int weight()
Returns the weight of this group member.- Returns:
- weight
-
instance
public PiActionProfileMember instance()
If present, returns the instance of the action profile member pointed by this reference, otherwise returns null. This method is provided as a convenient way to perform one-shot group programming, and as such is meaningful only when performing write operations to a device. In other words, when reading groups from a device only the member reference should be returned and not the actual instance, hence this method should return null.- Returns:
- action profile member instance, or null
-
-