Record Class ActiveLaw
java.lang.Object
java.lang.Record
net.chen.legacyLand.nation.law.ActiveLaw
- Record Components:
expiresAt- 0 = 永久
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of theenactedAtrecord component.Returns the value of theenactedByrecord component.final booleanIndicates whether some other object is "equal to" this one.longReturns the value of theexpiresAtrecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.booleanbooleanReturns the value of thenationNamerecord component.Returns the value of theparamsJsonrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
ActiveLaw
public ActiveLaw(String id, String nationName, LawType type, String paramsJson, String enactedBy, long enactedAt, long expiresAt) Creates an instance of aActiveLawrecord class.- Parameters:
id- the value for theidrecord componentnationName- the value for thenationNamerecord componenttype- the value for thetyperecord componentparamsJson- the value for theparamsJsonrecord componentenactedBy- the value for theenactedByrecord componentenactedAt- the value for theenactedAtrecord componentexpiresAt- the value for theexpiresAtrecord component
-
-
Method Details
-
isExpired
public boolean isExpired() -
isPermanent
public boolean isPermanent() -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
nationName
Returns the value of thenationNamerecord component.- Returns:
- the value of the
nationNamerecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
paramsJson
Returns the value of theparamsJsonrecord component.- Returns:
- the value of the
paramsJsonrecord component
-
enactedBy
Returns the value of theenactedByrecord component.- Returns:
- the value of the
enactedByrecord component
-
enactedAt
public long enactedAt()Returns the value of theenactedAtrecord component.- Returns:
- the value of the
enactedAtrecord component
-
expiresAt
-