Module technology.sola.engine
Record Class JsonElementAsset
java.lang.Object
java.lang.Record
technology.sola.engine.assets.json.JsonElementAsset
- Record Components:
jsonElement
- the loaded and parsed JSON file as aJsonElement
- All Implemented Interfaces:
Asset
@NullMarked
public record JsonElementAsset(technology.sola.json.JsonElement jsonElement)
extends Record
implements Asset
Represents a JSON file
Asset
that was loaded.-
Constructor Summary
ConstructorsConstructorDescriptionJsonElementAsset
(technology.sola.json.JsonElement jsonElement) Creates an instance of aJsonElementAsset
record class. -
Method Summary
Modifier and TypeMethodDescriptiontechnology.sola.json.JsonArray
asArray()
technology.sola.json.JsonObject
asObject()
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.technology.sola.json.JsonElement
Returns the value of thejsonElement
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
JsonElementAsset
public JsonElementAsset(technology.sola.json.JsonElement jsonElement) Creates an instance of aJsonElementAsset
record class.- Parameters:
jsonElement
- the value for thejsonElement
record component
-
-
Method Details
-
asObject
public technology.sola.json.JsonObject asObject()- Returns:
- the
JsonElement.asObject()
-
asArray
public technology.sola.json.JsonArray asArray()- Returns:
- the
JsonElement.asArray()
-
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)
. -
jsonElement
public technology.sola.json.JsonElement jsonElement()Returns the value of thejsonElement
record component.- Returns:
- the value of the
jsonElement
record component
-