Package io.grpc

Class InternalLogId


  • @Internal
    public final class InternalLogId
    extends java.lang.Object
    An internal class. Do not use.

    An object that has an ID that is unique within the JVM, primarily for debug logging.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String details  
      private long id  
      private static java.util.concurrent.atomic.AtomicLong idAlloc  
      private java.lang.String typeName  
    • Constructor Summary

      Constructors 
      Constructor Description
      InternalLogId​(java.lang.String typeName, java.lang.String details, long id)  
    • Field Detail

      • idAlloc

        private static final java.util.concurrent.atomic.AtomicLong idAlloc
      • typeName

        private final java.lang.String typeName
      • details

        @Nullable
        private final java.lang.String details
      • id

        private final long id
    • Constructor Detail

      • InternalLogId

        InternalLogId​(java.lang.String typeName,
                      java.lang.String details,
                      long id)
    • Method Detail

      • allocate

        public static InternalLogId allocate​(java.lang.Class<?> type,
                                             @Nullable
                                             java.lang.String details)
        Creates a log id.
        Parameters:
        type - the "Type" to be used when logging this id. The short name of this class will be used, or else a default if the class is anonymous.
        details - a short, human readable string that describes the object the id is attached to. Typically this will be an address or target.
      • allocate

        public static InternalLogId allocate​(java.lang.String typeName,
                                             @Nullable
                                             java.lang.String details)
        Creates a log id.
        Parameters:
        typeName - the "Type" to be used when logging this id.
        details - a short, human readable string that describes the object the id is attached to. Typically this will be an address or target.
      • getNextId

        static long getNextId()
      • getTypeName

        public java.lang.String getTypeName()
      • getDetails

        @Nullable
        public java.lang.String getDetails()
      • getId

        public long getId()
      • toString

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

        private static java.lang.String getClassName​(java.lang.Class<?> type)
      • shortName

        public java.lang.String shortName()