Class Domains

java.lang.Object
net.andreinc.mockneat.abstraction.MockUnitBase
net.andreinc.mockneat.unit.networking.Domains
All Implemented Interfaces:
MockUnit<java.lang.String>, MockUnitString

public class Domains
extends MockUnitBase
implements MockUnitString
  • Constructor Details

  • Method Details

    • domains

      public static Domains domains()

      Returns a Domains object

      that can be used to generate domain names. (eg.: "www", "info")

      Note: By default "popular" domains will be generated (like: "com", "org", "net", "edu", "gov", "info", "io")

      Returns:
      A re-usable Domains object. The Domains class implements MockUnitString
    • supplier

      public java.util.function.Supplier<java.lang.String> supplier()
      Description copied from interface: MockUnit
      This is the sole abstract method of the interface. Needs to be implemented every-time a MockUnit is implemented.
      Specified by:
      supplier in interface MockUnit<java.lang.String>
      Returns:
      A Supplier<T>.
    • popular

      public MockUnitString popular()

      Returns a new MockUnitString that can be used to generate popular domain names (like: "com", "org", "net", "edu", "gov", "info", "io").

      Returns:
      A new MockUnitString.
    • all

      public MockUnitString all()

      Returns a new MockUnitString that can be used to generate domain names, both popular (eg.: "com") or lesser known ("cern", "chat).

      Returns:
      A new MockUnitString
    • type

      public MockUnitString type​(DomainSuffixType type)

      Returns a new MockUnitString that can be used to generate domains based on the specified DomainSuffixType.

      Parameters:
      type - The type of the domains to generated.
      Returns:
      A new MockUnitString
    • types

      public MockUnitString types​(DomainSuffixType... types)

      Returns a new MockUnitString that can be used to generate domain names based on the specified DomainSuffixTypes.

      Parameters:
      types - A var-arg array of DomainSuffixType.
      Returns:
      A new MockUnitString