Class NTInfo

java.lang.Object
com.io7m.jnoisetype.api.NTInfo
All Implemented Interfaces:
NTInfoType

public final class NTInfo extends Object implements NTInfoType
See Also:
  • "SoundFontⓡ Technical Specification 2.04, §5 The INFO-list Chunk"
  • Method Details

    • version

      public NTVersion version()
      Specified by:
      version in interface NTInfoType
      Returns:
      The version of the specification to which the file is expected to comply
    • soundEngine

      public NTShortString soundEngine()
      Specified by:
      soundEngine in interface NTInfoType
      Returns:
      The wavetable sound engine for which the file was optimized
    • name

      public NTShortString name()
      Specified by:
      name in interface NTInfoType
      Returns:
      The name of the SoundFont compatible bank
    • rom

      public Optional<NTShortString> rom()
      Specified by:
      rom in interface NTInfoType
      Returns:
      A particular wavetable sound data ROM to which any ROM samples refer
    • romRevision

      public Optional<NTVersion> romRevision()
      Specified by:
      romRevision in interface NTInfoType
      Returns:
      The particular wavetable sound data ROM revision to which any ROM samples refer
    • creationDate

      public Optional<NTShortString> creationDate()
      Specified by:
      creationDate in interface NTInfoType
      Returns:
      The creation date of the SoundFont
    • engineers

      public Optional<NTShortString> engineers()
      Specified by:
      engineers in interface NTInfoType
      Returns:
      The engineers responsible for the creation of the SoundFont
    • product

      public Optional<NTShortString> product()
      Specified by:
      product in interface NTInfoType
      Returns:
      Any specific product for which the SoundFont compatible bank is intended
    • copyright

      public Optional<NTShortString> copyright()
      Specified by:
      copyright in interface NTInfoType
      Returns:
      Any copyright assertion string associated with the SoundFont compatible bank
    • comment

      public Optional<NTLongString> comment()
      Specified by:
      comment in interface NTInfoType
      Returns:
      Any comment text associated with the SoundFont compatible bank
    • software

      public Optional<NTShortString> software()
      Specified by:
      software in interface NTInfoType
      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 the version attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for version
      Returns:
      A modified copy of the this object
    • withSoundEngine

      public final NTInfo withSoundEngine(NTShortString value)
      Copy the current immutable object by setting a value for the soundEngine attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for soundEngine
      Returns:
      A modified copy of the this object
    • withName

      public final NTInfo withName(NTShortString value)
      Copy the current immutable object by setting a value for the name attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for name
      Returns:
      A modified copy of the this object
    • withRom

      public final NTInfo withRom(NTShortString value)
      Copy the current immutable object by setting a present value for the optional rom attribute.
      Parameters:
      value - The value for rom
      Returns:
      A modified copy of this object
    • withRom

      public final NTInfo withRom(Optional<? extends NTShortString> optional)
      Copy the current immutable object by setting an optional value for the rom attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for rom
      Returns:
      A modified copy of this object
    • withRomRevision

      public final NTInfo withRomRevision(NTVersion value)
      Copy the current immutable object by setting a present value for the optional romRevision attribute.
      Parameters:
      value - The value for romRevision
      Returns:
      A modified copy of this object
    • withRomRevision

      public final NTInfo withRomRevision(Optional<? extends NTVersion> optional)
      Copy the current immutable object by setting an optional value for the romRevision attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for romRevision
      Returns:
      A modified copy of this object
    • withCreationDate

      public final NTInfo withCreationDate(NTShortString value)
      Copy the current immutable object by setting a present value for the optional creationDate attribute.
      Parameters:
      value - The value for creationDate
      Returns:
      A modified copy of this object
    • withCreationDate

      public final NTInfo withCreationDate(Optional<? extends NTShortString> optional)
      Copy the current immutable object by setting an optional value for the creationDate attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for creationDate
      Returns:
      A modified copy of this object
    • withEngineers

      public final NTInfo withEngineers(NTShortString value)
      Copy the current immutable object by setting a present value for the optional engineers attribute.
      Parameters:
      value - The value for engineers
      Returns:
      A modified copy of this object
    • withEngineers

      public final NTInfo withEngineers(Optional<? extends NTShortString> optional)
      Copy the current immutable object by setting an optional value for the engineers attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for engineers
      Returns:
      A modified copy of this object
    • withProduct

      public final NTInfo withProduct(NTShortString value)
      Copy the current immutable object by setting a present value for the optional product attribute.
      Parameters:
      value - The value for product
      Returns:
      A modified copy of this object
    • withProduct

      public final NTInfo withProduct(Optional<? extends NTShortString> optional)
      Copy the current immutable object by setting an optional value for the product attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for product
      Returns:
      A modified copy of this object
    • withCopyright

      public final NTInfo withCopyright(NTShortString value)
      Copy the current immutable object by setting a present value for the optional copyright attribute.
      Parameters:
      value - The value for copyright
      Returns:
      A modified copy of this object
    • withCopyright

      public final NTInfo withCopyright(Optional<? extends NTShortString> optional)
      Copy the current immutable object by setting an optional value for the copyright attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for copyright
      Returns:
      A modified copy of this object
    • withComment

      public final NTInfo withComment(NTLongString value)
      Copy the current immutable object by setting a present value for the optional comment attribute.
      Parameters:
      value - The value for comment
      Returns:
      A modified copy of this object
    • withComment

      public final NTInfo withComment(Optional<? extends NTLongString> optional)
      Copy the current immutable object by setting an optional value for the comment attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for comment
      Returns:
      A modified copy of this object
    • withSoftware

      public final NTInfo withSoftware(NTShortString value)
      Copy the current immutable object by setting a present value for the optional software attribute.
      Parameters:
      value - The value for software
      Returns:
      A modified copy of this object
    • withSoftware

      public final NTInfo withSoftware(Optional<? extends NTShortString> optional)
      Copy the current immutable object by setting an optional value for the software attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for software
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of NTInfo that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: version, soundEngine, name, rom, romRevision, creationDate, engineers, product, copyright, comment, software.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value NTInfo with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static NTInfo copyOf(NTInfoType instance)
      Creates an immutable copy of a NTInfoType value. 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 for NTInfo.
       NTInfo.builder()
          .setVersion(com.io7m.jnoisetype.api.NTVersion) // required version
          .setSoundEngine(com.io7m.jnoisetype.api.NTShortString) // optional soundEngine
          .setName(com.io7m.jnoisetype.api.NTShortString) // required name
          .setRom(NTShortString) // optional rom
          .setRomRevision(NTVersion) // optional romRevision
          .setCreationDate(NTShortString) // optional creationDate
          .setEngineers(NTShortString) // optional engineers
          .setProduct(NTShortString) // optional product
          .setCopyright(NTShortString) // optional copyright
          .setComment(NTLongString) // optional comment
          .setSoftware(NTShortString) // optional software
          .build();
       
      Returns:
      A new NTInfo builder