Record Class AttrOption<T>
java.lang.Object
java.lang.Record
com.iohao.net.common.kit.attr.AttrOption<T>
- Type Parameters:
T- The type of the attribute value
- All Implemented Interfaces:
Serializable
-
Constructor Summary
ConstructorsConstructorDescriptionAttrOption(String name, T defaultValue, Supplier<T> supplier) Creates an instance of aAttrOptionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedefaultValuerecord component.booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.supplier()Returns the value of thesupplierrecord component.final StringtoString()Returns a string representation of this record class.static <T> AttrOption<T> Initializes an AttrOptionstatic <T> AttrOption<T> Initializes an AttrOptionstatic <T> AttrOption<T> Initializes an AttrOption
-
Constructor Details
-
AttrOption
-
-
Method Details
-
valueOf
Initializes an AttrOption- Type Parameters:
T- The type of the attribute value- Parameters:
name- name- Returns:
- AttrOption
-
valueOf
Initializes an AttrOption- Type Parameters:
T- The type of the attribute value- Parameters:
name- namedefaultValue- Default value (singleton)- Returns:
- AttrOption
-
valueOf
Initializes an AttrOption- Type Parameters:
T- The type of the attribute value- Parameters:
name- namesupplier- Supplier to get the value from if the value does not exist- Returns:
- AttrOption
-
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). -
hashCode
-
toString
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
defaultValue
Returns the value of thedefaultValuerecord component.- Returns:
- the value of the
defaultValuerecord component
-
supplier
-