Record Class ModuleContent
java.lang.Object
java.lang.Record
com.ultikits.ultitools.utils.ModuleContent
- Record Components:
kinds- the kinds, at mostMAX_KINDS, each kind at most once, in canonical order
The custom game content one module added, by kind, heaviest consequence first.
- Since:
- 7.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<ModuleContentKind> The field for thekindsrecord component.static final intThe most kinds one module reports.static final ModuleContentNo custom content. -
Constructor Summary
ConstructorsConstructorDescriptionModuleContent(List<ModuleContentKind> kinds) Copies and sorts the kinds, putting known consequences first and future kinds alphabetically. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.@Nullable ModuleContentKindReturns the entry for the given kind, ornull.final inthashCode()Returns a hash code value for this object.booleanisEmpty()Returns whether this module added no custom content.kinds()Returns the value of thekindsrecord component.final StringtoString()Returns a string representation of this record class.static ModuleContentunknown()Returns content that says only "this module may have added custom content".
-
Field Details
-
kinds
The field for thekindsrecord component. -
MAX_KINDS
public static final int MAX_KINDSThe most kinds one module reports.- See Also:
-
NONE
No custom content.
-
-
Constructor Details
-
ModuleContent
Copies and sorts the kinds, putting known consequences first and future kinds alphabetically.- Parameters:
kinds- the kinds, ornullfor no custom content- Throws:
NullPointerException- if an element isnullIllegalArgumentException- if a kind is repeated or there are more thanMAX_KINDS
-
-
Method Details
-
unknown
Returns content that says only "this module may have added custom content".- Returns:
- one unknown kind, without a count
-
isEmpty
public boolean isEmpty()Returns whether this module added no custom content.- Returns:
- whether there are no kinds
-
find
Returns the entry for the given kind, ornull.- Parameters:
kind- the kind to find- Returns:
- the entry, or
nullif it is absent
-
toString
-
hashCode
-
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). -
kinds
-