Class Claim

java.lang.Object
org.refcodes.decoupling.Claim
All Implemented Interfaces:
Comparable<Claim>, org.refcodes.mixin.AliasAccessor, org.refcodes.mixin.TypeAccessor, org.refcodes.schema.Schemable
Direct Known Subclasses:
FactoryClaim, InitializerClaim

public class Claim extends Object implements org.refcodes.mixin.AliasAccessor, org.refcodes.mixin.TypeAccessor, org.refcodes.schema.Schemable, Comparable<Claim>
A claim describes a Claim required by a Dependency.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.refcodes.mixin.AliasAccessor

    org.refcodes.mixin.AliasAccessor.AliasBuilder<B>, org.refcodes.mixin.AliasAccessor.AliasMutator, org.refcodes.mixin.AliasAccessor.AliasProperty

    Nested classes/interfaces inherited from interface org.refcodes.mixin.TypeAccessor

    org.refcodes.mixin.TypeAccessor.TypeBuilder<T,B>, org.refcodes.mixin.TypeAccessor.TypeMutator<T>, org.refcodes.mixin.TypeAccessor.TypeProperty<T>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected String
     
    protected Class<?>
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Instantiates a new Claim.
     
    Claim(Class<?> aType)
    Constructs a Claim for the given type (the alias is, if not provided, derived from type).
     
    Claim(Class<?> aType, String aAlias)
    Constructs a Claim for the given type (the alias is, if not provided, derived from type).
     
    Claim(String aAlias)
    Constructs a Claim for the given type (the alias is, if not provided, derived from type).
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    compareTo(Claim aClaim)
    boolean
    int
    boolean
    isClaim(Dependency<?> aDependency)
    Determines whether the given Dependency declaration matches this Claim instance.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • _alias

      protected String _alias
    • _type

      protected Class<?> _type
  • Constructor Details

    • Claim

      protected Claim()
      Instantiates a new Claim.
    • Claim

      public Claim(Class<?> aType)
      Constructs a Claim for the given type (the alias is, if not provided, derived from type).
      Parameters:
      aType - The type of the Claim.
    • Claim

      public Claim(String aAlias)
      Constructs a Claim for the given type (the alias is, if not provided, derived from type).
      Parameters:
      aAlias - The alias for the Claim.
    • Claim

      public Claim(Class<?> aType, String aAlias)
      Constructs a Claim for the given type (the alias is, if not provided, derived from type).
      Parameters:
      aType - The type of the Claim.
      aAlias - The alias for the Claim.
  • Method Details

    • getAlias

      public String getAlias()
      Specified by:
      getAlias in interface org.refcodes.mixin.AliasAccessor
    • getType

      public Class getType()
      Specified by:
      getType in interface org.refcodes.mixin.TypeAccessor
    • isClaim

      public boolean isClaim(Dependency<?> aDependency)
      Determines whether the given Dependency declaration matches this Claim instance.
      Parameters:
      aDependency - The Dependency declaration which to match against this Claim instance.
      Returns:
      True in case the Claim instance can be satisfied by the given Dependency declaration.
    • toSchema

      public DependencySchema toSchema()
      Specified by:
      toSchema in interface org.refcodes.schema.Schemable
    • compareTo

      public int compareTo(Claim aClaim)
      Specified by:
      compareTo in interface Comparable<Claim>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object