Record Class WorldSpec
java.lang.Object
java.lang.Record
nl.pim16aap2.lightkeeper.framework.WorldSpec
- Record Components:
name- World name.worldType- World type.environment- World environment.seed- World seed.
public record WorldSpec(String name, WorldSpec.WorldType worldType, WorldSpec.WorldEnvironment environment, long seed)
extends Record
World creation specification.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Constructor Summary
ConstructorsConstructorDescriptionWorldSpec(String name, WorldSpec.WorldType worldType, WorldSpec.WorldEnvironment environment, long seed) Creates an instance of aWorldSpecrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theenvironmentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.longseed()Returns the value of theseedrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theworldTyperecord component.
-
Constructor Details
-
WorldSpec
public WorldSpec(String name, WorldSpec.WorldType worldType, WorldSpec.WorldEnvironment environment, long seed) Creates an instance of aWorldSpecrecord class.- Parameters:
name- the value for thenamerecord componentworldType- the value for theworldTyperecord componentenvironment- the value for theenvironmentrecord componentseed- the value for theseedrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
worldType
Returns the value of theworldTyperecord component.- Returns:
- the value of the
worldTyperecord component
-
environment
Returns the value of theenvironmentrecord component.- Returns:
- the value of the
environmentrecord component
-
seed
public long seed()Returns the value of theseedrecord component.- Returns:
- the value of the
seedrecord component
-