Package com.tnsai.spi
Record Class FlagContext
java.lang.Object
java.lang.Record
com.tnsai.spi.FlagContext
- Record Components:
tenantId- tenant the decision is for, ornullagentId- agent the decision is for, ornull
Evaluation context for
FeatureFlag.isEnabled(String, FlagContext).
tenantId and agentId are optional. Percent rollouts
hash the tenant when present, otherwise the agent. Allow-lists match
either identity.
-
Constructor Summary
ConstructorsConstructorDescriptionFlagContext(String tenantId, String agentId) Creates an instance of aFlagContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionagentId()Returns the value of theagentIdrecord component.static FlagContextempty()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static FlagContexttenantId()Returns the value of thetenantIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
empty
-
of
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
tenantId
Returns the value of thetenantIdrecord component.- Returns:
- the value of the
tenantIdrecord component
-
agentId
Returns the value of theagentIdrecord component.- Returns:
- the value of the
agentIdrecord component
-