Class StringSlot<T>

java.lang.Object
org.incenp.obofoundry.sssom.slots.Slot<T>
org.incenp.obofoundry.sssom.slots.StringSlot<T>
Type Parameters:
T - The type of SSSOM object the slot is associated with.
Direct Known Subclasses:
EntityReferenceSlot, URISlot

public class StringSlot<T> extends Slot<T>
Represents a metadata slot that is backed by a String-typed field.
  • Method Details

    • isMultivalued

      public boolean isMultivalued()
      Indicates whether the slot holds a list of values rather than a single value.
      Returns:
      true is the slot is multivalued, otherwise false.
    • accept

      public void accept(ISlotVisitor<T> visitor, T target, Object value)
      Description copied from class: Slot
      Accepts a visitor.
      Overrides:
      accept in class Slot<T>
      Parameters:
      visitor - The visitor to accept.
      target - The object this slot is attached to.
      value - The value of the slot.
    • setValue

      public void setValue(T object, String value)
      Description copied from class: Slot
      Tries setting the value of the slot for a given object, using a string as input.

      This method only works for String-typed slots, but classes for other slot types can override it to allow parsing a string into another type of value.

      Overrides:
      setValue in class Slot<T>
      Parameters:
      object - The object (e.g. a mapping or a mapping set) for which the slot should be set.
      value - The value to assign to the slot on the given object.