Class CompositeKey


  • public class CompositeKey
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String NAMESPACE  
    • Constructor Summary

      Constructors 
      Constructor Description
      CompositeKey​(java.lang.String objectType, java.lang.String... attributes)  
      CompositeKey​(java.lang.String objectType, java.util.List<java.lang.String> attributes)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.String> getAttributes()  
      java.lang.String getObjectType()  
      static CompositeKey parseCompositeKey​(java.lang.String compositeKey)  
      java.lang.String toString()  
      static void validateSimpleKeys​(java.lang.String... keys)
      To ensure that simple keys do not go into composite key namespace, we validate simple key to check whether the key starts with 0x00 (which is the namespace for compositeKey).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • NAMESPACE

        public static final java.lang.String NAMESPACE
    • Constructor Detail

      • CompositeKey

        public CompositeKey​(java.lang.String objectType,
                            java.lang.String... attributes)
        Parameters:
        objectType -
        attributes -
      • CompositeKey

        public CompositeKey​(java.lang.String objectType,
                            java.util.List<java.lang.String> attributes)
        Parameters:
        objectType -
        attributes -
    • Method Detail

      • getObjectType

        public java.lang.String getObjectType()
        Returns:
        object type
      • getAttributes

        public java.util.List<java.lang.String> getAttributes()
        Returns:
        List of string arguments
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • parseCompositeKey

        public static CompositeKey parseCompositeKey​(java.lang.String compositeKey)
        Parameters:
        compositeKey -
        Returns:
        Composite Key
      • validateSimpleKeys

        public static void validateSimpleKeys​(java.lang.String... keys)
        To ensure that simple keys do not go into composite key namespace, we validate simple key to check whether the key starts with 0x00 (which is the namespace for compositeKey). This helps in avoiding simple/composite key collisions.
        Parameters:
        keys - the list of simple keys
        Throws:
        org.hyperledger.fabric.shim.ledger.CompositeKeyFormatException - if First character of the key