Record Class ValidSoundRecord
java.lang.Object
java.lang.Record
com.winterhavenmc.library.messagebuilder.models.sound.ValidSoundRecord
- Record Components:
key-Sectionthe key for the sound entryenabled-booleanif the sound entry is enabled for playbackplayerOnly-booleanif the sound entry should be played for an individual or for a locationsoundName-Sectionthe bukkit Sound constant name, formerly an enum but now contained in the bukkit registryvolume-floatthe volume of playback for the sound entrypitch-floatthe pitch of playback for the sound entry
- All Implemented Interfaces:
SoundRecord
public record ValidSoundRecord(String key, boolean enabled, boolean playerOnly, String soundName, float volume, float pitch)
extends Record
implements SoundRecord
A class that contains the key and fields of a sound entry in the sound configuration
-
Constructor Summary
ConstructorsConstructorDescriptionValidSoundRecord(String key, boolean enabled, boolean playerOnly, String soundName, float volume, float pitch) Creates an instance of aValidSoundRecordrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanenabled()Returns the value of theenabledrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.floatpitch()Returns the value of thepitchrecord component.booleanReturns the value of theplayerOnlyrecord component.Returns the value of thesoundNamerecord component.final StringtoString()Returns a string representation of this record class.floatvolume()Returns the value of thevolumerecord component.
-
Constructor Details
-
ValidSoundRecord
public ValidSoundRecord(String key, boolean enabled, boolean playerOnly, String soundName, float volume, float pitch) Creates an instance of aValidSoundRecordrecord class.- Parameters:
key- the value for thekeyrecord componentenabled- the value for theenabledrecord componentplayerOnly- the value for theplayerOnlyrecord componentsoundName- the value for thesoundNamerecord componentvolume- the value for thevolumerecord componentpitch- the value for thepitchrecord 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 '=='. -
key
Returns the value of thekeyrecord component.- Specified by:
keyin interfaceSoundRecord- Returns:
- the value of the
keyrecord component
-
enabled
public boolean enabled()Returns the value of theenabledrecord component.- Returns:
- the value of the
enabledrecord component
-
playerOnly
public boolean playerOnly()Returns the value of theplayerOnlyrecord component.- Returns:
- the value of the
playerOnlyrecord component
-
soundName
Returns the value of thesoundNamerecord component.- Returns:
- the value of the
soundNamerecord component
-
volume
public float volume()Returns the value of thevolumerecord component.- Returns:
- the value of the
volumerecord component
-
pitch
public float pitch()Returns the value of thepitchrecord component.- Returns:
- the value of the
pitchrecord component
-