Record Class SourceName

java.lang.Object
java.lang.Record
no.unit.nva.model.SourceName
Record Components:
system - the system name of the source. e.g. "brage", "cristin" or "nva"
instanceName - the instance name of the source. e.g. "194.0.0.0", "20754.0.0.0", etc

public record SourceName(String system, String instanceName) extends Record
A record representing a source name.
  • Field Details

  • Constructor Details

    • SourceName

      public SourceName(String system, String instanceName)
      Creates an instance of a SourceName record class.
      Parameters:
      system - the value for the system record component
      instanceName - the value for the instanceName record component
  • Method Details

    • toString

      public String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • fromBrage

      public static SourceName fromBrage(String instanceName)
      A record representing a brage source for a given instance.
      Parameters:
      instanceName - the instance name of the source. e.g. "194.0.0.0", "20754.0.0.0", etc
    • fromCristin

      public static SourceName fromCristin(String instanceName)
      A record representing a cristin source for a given instance.
      Parameters:
      instanceName - the instance name of the source. e.g. "194.0.0.0", "20754.0.0.0", etc
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • system

      public String system()
      Returns the value of the system record component.
      Returns:
      the value of the system record component
    • instanceName

      public String instanceName()
      Returns the value of the instanceName record component.
      Returns:
      the value of the instanceName record component