Interface HostNameData

All Superinterfaces:
java.lang.Iterable<java.lang.String>, java.io.Serializable
All Known Implementing Classes:
ConcreteHostNameData, HostNameDataNullObject

public interface HostNameData
extends java.lang.Iterable<java.lang.String>, java.io.Serializable
Host Name Data - the interface defines the methods, both concrete object and null object must provide
Author:
Karl Eilebrecht
  • Method Summary

    Modifier and Type Method Description
    boolean addHostName​(java.lang.String name)
    Adds the name to the list
    boolean contains​(java.lang.String name)
    Returns whether this list contains the name
    boolean containsAll​(java.util.Collection<? extends java.lang.String> names)
    Returns whether the list contains all of the given names
    <T extends HostNameData>
    T
    copy()
    Creates a copy of this object, so that the internal state of the copy will be independent.
    This is not a deep clone as the values will not be copied but referenced.
    java.lang.String get​(int index)
    Returns the name at the given position
    int getNumberOfEntries()
    Returns the number of entries in host name data
    java.lang.String getPurpose()
    returns the purpose (whatever this might be :-) )
    int indexOf​(java.lang.String name)
    Returns the position of the given entry
    java.lang.String[] toArray()
    Returns an array with all the names from the list

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator
  • Method Details

    • getNumberOfEntries

      Returns the number of entries in host name data
      Returns:
      number of entries
    • getPurpose

      java.lang.String getPurpose()
      returns the purpose (whatever this might be :-) )
      Returns:
      purpose of list
    • contains

      boolean contains​(java.lang.String name)
      Returns whether this list contains the name
      Parameters:
      name - the host name to look for
      Returns:
      true if found
    • indexOf

      int indexOf​(java.lang.String name)
      Returns the position of the given entry
      Parameters:
      name - the host name to look for
      Returns:
      true if found otherwise -1
    • containsAll

      boolean containsAll​(java.util.Collection<? extends java.lang.String> names)
      Returns whether the list contains all of the given names
      Parameters:
      names - collection of names to look for
      Returns:
      true if all names of the given list where found in this list
    • toArray

      java.lang.String[] toArray()
      Returns an array with all the names from the list
      Returns:
      array of names
    • get

      java.lang.String get​(int index)
      Returns the name at the given position
      Parameters:
      index - position
      Returns:
      name at the given index or null if not found
    • addHostName

      boolean addHostName​(java.lang.String name)
      Adds the name to the list
      Parameters:
      name - host name
      Returns:
      true if the name was added, false otherwise
    • copy

      <T extends HostNameData> T copy()
      Creates a copy of this object, so that the internal state of the copy will be independent.
      This is not a deep clone as the values will not be copied but referenced.
      Type Parameters:
      T - expected concrete class implementing HostNameData
      Returns:
      copy of this object