Class PrefixNamespace

java.lang.Object
com.caplin.datasource.namespace.PrefixNamespace
All Implemented Interfaces:
Namespace

public class PrefixNamespace extends Object implements Namespace

The prefix namespace matches the initial part of a subject name.

 

A prefix namespace matches a subject according to the start of the subject name. For example, if the prefix defined for the namespace is is /I/ and the subject presented is /I/VOD.L the match(String) method will return true. Should the presented subject be /R/VOD.L the match(String) method will return false.

  • Constructor Details

    • PrefixNamespace

      public PrefixNamespace(String prefix)
      Initializes a new instance of the PrefixNamespace class.
      Parameters:
      prefix - The prefix to be matched. For example, /FX.
  • Method Details

    • match

      public boolean match(String subject)

      Tests a String to see if it falls within this Namespace.

      Specified by:
      match in interface Namespace
      Parameters:
      subject - The string to be tested for matching.
      Returns:
      true if subject falls within this Namespace, false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object