Package com.io7m.jnoisetype.api
Class NTInfo
- java.lang.Object
-
- com.io7m.jnoisetype.api.NTInfo
-
- All Implemented Interfaces:
NTInfoType
public final class NTInfo extends java.lang.Object implements NTInfoType
- See Also:
- "SoundFontⓡ Technical Specification 2.04, §5 The INFO-list Chunk"
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNTInfo.BuilderBuilds instances of typeNTInfo.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NTInfo.Builderbuilder()Creates a builder forNTInfo.java.util.Optional<NTLongString>comment()static NTInfocopyOf(NTInfoType instance)Creates an immutable copy of aNTInfoTypevalue.java.util.Optional<NTShortString>copyright()java.util.Optional<NTShortString>creationDate()java.util.Optional<NTShortString>engineers()booleanequals(java.lang.Object another)This instance is equal to all instances ofNTInfothat have equal attribute values.inthashCode()Computes a hash code from attributes:version,soundEngine,name,rom,romRevision,creationDate,engineers,product,copyright,comment,software.NTShortStringname()java.util.Optional<NTShortString>product()java.util.Optional<NTShortString>rom()java.util.Optional<NTVersion>romRevision()java.util.Optional<NTShortString>software()NTShortStringsoundEngine()java.lang.StringtoString()Prints the immutable valueNTInfowith attribute values.NTVersionversion()NTInfowithComment(NTLongString value)Copy the current immutable object by setting a present value for the optionalcommentattribute.NTInfowithComment(java.util.Optional<? extends NTLongString> optional)Copy the current immutable object by setting an optional value for thecommentattribute.NTInfowithCopyright(NTShortString value)Copy the current immutable object by setting a present value for the optionalcopyrightattribute.NTInfowithCopyright(java.util.Optional<? extends NTShortString> optional)Copy the current immutable object by setting an optional value for thecopyrightattribute.NTInfowithCreationDate(NTShortString value)Copy the current immutable object by setting a present value for the optionalcreationDateattribute.NTInfowithCreationDate(java.util.Optional<? extends NTShortString> optional)Copy the current immutable object by setting an optional value for thecreationDateattribute.NTInfowithEngineers(NTShortString value)Copy the current immutable object by setting a present value for the optionalengineersattribute.NTInfowithEngineers(java.util.Optional<? extends NTShortString> optional)Copy the current immutable object by setting an optional value for theengineersattribute.NTInfowithName(NTShortString value)Copy the current immutable object by setting a value for thenameattribute.NTInfowithProduct(NTShortString value)Copy the current immutable object by setting a present value for the optionalproductattribute.NTInfowithProduct(java.util.Optional<? extends NTShortString> optional)Copy the current immutable object by setting an optional value for theproductattribute.NTInfowithRom(NTShortString value)Copy the current immutable object by setting a present value for the optionalromattribute.NTInfowithRom(java.util.Optional<? extends NTShortString> optional)Copy the current immutable object by setting an optional value for theromattribute.NTInfowithRomRevision(NTVersion value)Copy the current immutable object by setting a present value for the optionalromRevisionattribute.NTInfowithRomRevision(java.util.Optional<? extends NTVersion> optional)Copy the current immutable object by setting an optional value for theromRevisionattribute.NTInfowithSoftware(NTShortString value)Copy the current immutable object by setting a present value for the optionalsoftwareattribute.NTInfowithSoftware(java.util.Optional<? extends NTShortString> optional)Copy the current immutable object by setting an optional value for thesoftwareattribute.NTInfowithSoundEngine(NTShortString value)Copy the current immutable object by setting a value for thesoundEngineattribute.NTInfowithVersion(NTVersion value)Copy the current immutable object by setting a value for theversionattribute.
-
-
-
Method Detail
-
version
public NTVersion version()
- Specified by:
versionin interfaceNTInfoType- Returns:
- The version of the specification to which the file is expected to comply
-
soundEngine
public NTShortString soundEngine()
- Specified by:
soundEnginein interfaceNTInfoType- Returns:
- The wavetable sound engine for which the file was optimized
-
name
public NTShortString name()
- Specified by:
namein interfaceNTInfoType- Returns:
- The name of the SoundFont compatible bank
-
rom
public java.util.Optional<NTShortString> rom()
- Specified by:
romin interfaceNTInfoType- Returns:
- A particular wavetable sound data ROM to which any ROM samples refer
-
romRevision
public java.util.Optional<NTVersion> romRevision()
- Specified by:
romRevisionin interfaceNTInfoType- Returns:
- The particular wavetable sound data ROM revision to which any ROM samples refer
-
creationDate
public java.util.Optional<NTShortString> creationDate()
- Specified by:
creationDatein interfaceNTInfoType- Returns:
- The creation date of the SoundFont
-
engineers
public java.util.Optional<NTShortString> engineers()
- Specified by:
engineersin interfaceNTInfoType- Returns:
- The engineers responsible for the creation of the SoundFont
-
product
public java.util.Optional<NTShortString> product()
- Specified by:
productin interfaceNTInfoType- Returns:
- Any specific product for which the SoundFont compatible bank is intended
-
copyright
public java.util.Optional<NTShortString> copyright()
- Specified by:
copyrightin interfaceNTInfoType- Returns:
- Any copyright assertion string associated with the SoundFont compatible bank
-
comment
public java.util.Optional<NTLongString> comment()
- Specified by:
commentin interfaceNTInfoType- Returns:
- Any comment text associated with the SoundFont compatible bank
-
software
public java.util.Optional<NTShortString> software()
- Specified by:
softwarein interfaceNTInfoType- Returns:
- The SoundFont compatible tools used to create and most recently modify the SoundFont compatible bank
-
withVersion
public final NTInfo withVersion(NTVersion value)
Copy the current immutable object by setting a value for theversionattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for version- Returns:
- A modified copy of the
thisobject
-
withSoundEngine
public final NTInfo withSoundEngine(NTShortString value)
Copy the current immutable object by setting a value for thesoundEngineattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for soundEngine- Returns:
- A modified copy of the
thisobject
-
withName
public final NTInfo withName(NTShortString value)
Copy the current immutable object by setting a value for thenameattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
withRom
public final NTInfo withRom(NTShortString value)
Copy the current immutable object by setting a present value for the optionalromattribute.- Parameters:
value- The value for rom- Returns:
- A modified copy of
thisobject
-
withRom
public final NTInfo withRom(java.util.Optional<? extends NTShortString> optional)
Copy the current immutable object by setting an optional value for theromattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for rom- Returns:
- A modified copy of
thisobject
-
withRomRevision
public final NTInfo withRomRevision(NTVersion value)
Copy the current immutable object by setting a present value for the optionalromRevisionattribute.- Parameters:
value- The value for romRevision- Returns:
- A modified copy of
thisobject
-
withRomRevision
public final NTInfo withRomRevision(java.util.Optional<? extends NTVersion> optional)
Copy the current immutable object by setting an optional value for theromRevisionattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for romRevision- Returns:
- A modified copy of
thisobject
-
withCreationDate
public final NTInfo withCreationDate(NTShortString value)
Copy the current immutable object by setting a present value for the optionalcreationDateattribute.- Parameters:
value- The value for creationDate- Returns:
- A modified copy of
thisobject
-
withCreationDate
public final NTInfo withCreationDate(java.util.Optional<? extends NTShortString> optional)
Copy the current immutable object by setting an optional value for thecreationDateattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for creationDate- Returns:
- A modified copy of
thisobject
-
withEngineers
public final NTInfo withEngineers(NTShortString value)
Copy the current immutable object by setting a present value for the optionalengineersattribute.- Parameters:
value- The value for engineers- Returns:
- A modified copy of
thisobject
-
withEngineers
public final NTInfo withEngineers(java.util.Optional<? extends NTShortString> optional)
Copy the current immutable object by setting an optional value for theengineersattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for engineers- Returns:
- A modified copy of
thisobject
-
withProduct
public final NTInfo withProduct(NTShortString value)
Copy the current immutable object by setting a present value for the optionalproductattribute.- Parameters:
value- The value for product- Returns:
- A modified copy of
thisobject
-
withProduct
public final NTInfo withProduct(java.util.Optional<? extends NTShortString> optional)
Copy the current immutable object by setting an optional value for theproductattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for product- Returns:
- A modified copy of
thisobject
-
withCopyright
public final NTInfo withCopyright(NTShortString value)
Copy the current immutable object by setting a present value for the optionalcopyrightattribute.- Parameters:
value- The value for copyright- Returns:
- A modified copy of
thisobject
-
withCopyright
public final NTInfo withCopyright(java.util.Optional<? extends NTShortString> optional)
Copy the current immutable object by setting an optional value for thecopyrightattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for copyright- Returns:
- A modified copy of
thisobject
-
withComment
public final NTInfo withComment(NTLongString value)
Copy the current immutable object by setting a present value for the optionalcommentattribute.- Parameters:
value- The value for comment- Returns:
- A modified copy of
thisobject
-
withComment
public final NTInfo withComment(java.util.Optional<? extends NTLongString> optional)
Copy the current immutable object by setting an optional value for thecommentattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for comment- Returns:
- A modified copy of
thisobject
-
withSoftware
public final NTInfo withSoftware(NTShortString value)
Copy the current immutable object by setting a present value for the optionalsoftwareattribute.- Parameters:
value- The value for software- Returns:
- A modified copy of
thisobject
-
withSoftware
public final NTInfo withSoftware(java.util.Optional<? extends NTShortString> optional)
Copy the current immutable object by setting an optional value for thesoftwareattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for software- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(java.lang.Object another)
This instance is equal to all instances ofNTInfothat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:version,soundEngine,name,rom,romRevision,creationDate,engineers,product,copyright,comment,software.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueNTInfowith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static NTInfo copyOf(NTInfoType instance)
Creates an immutable copy of aNTInfoTypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable NTInfo instance
-
builder
public static NTInfo.Builder builder()
Creates a builder forNTInfo.NTInfo.builder() .setVersion(com.io7m.jnoisetype.api.NTVersion) // requiredversion.setSoundEngine(com.io7m.jnoisetype.api.NTShortString) // optionalsoundEngine.setName(com.io7m.jnoisetype.api.NTShortString) // requiredname.setRom(NTShortString) // optionalrom.setRomRevision(NTVersion) // optionalromRevision.setCreationDate(NTShortString) // optionalcreationDate.setEngineers(NTShortString) // optionalengineers.setProduct(NTShortString) // optionalproduct.setCopyright(NTShortString) // optionalcopyright.setComment(NTLongString) // optionalcomment.setSoftware(NTShortString) // optionalsoftware.build();- Returns:
- A new NTInfo builder
-
-