Class RawField

  • All Implemented Interfaces:
    Field

    public final class RawField
    extends java.lang.Object
    implements Field

    Raw (unstructured) MIME field. The field's body is unparsed and possibly encoded.

    Instances of this class can be created by using RawFieldParser.parseField(ByteSequence) method.

    • Constructor Summary

      Constructors 
      Constructor Description
      RawField​(java.lang.String name, java.lang.String body)  
      RawField​(ByteSequence raw, int delimiterIdx, java.lang.String name, java.lang.String body)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getBody()
      Gets the unparsed and possibly encoded (see RFC 2047) field body string.
      int getDelimiterIdx()  
      java.lang.String getName()
      Returns the name of the field.
      java.lang.String getNameLowerCase()
      Returns the name of the field in lower case.
      ByteSequence getRaw()
      Gets original (raw) representation of the field, if available, null otherwise.
      private static boolean isSpace​(java.lang.String body, int pos)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • delimiterIdx

        private final int delimiterIdx
      • name

        private final java.lang.String name
      • body

        private final java.lang.String body
      • nameLowerCase

        private java.lang.String nameLowerCase
    • Constructor Detail

      • RawField

        RawField​(ByteSequence raw,
                 int delimiterIdx,
                 java.lang.String name,
                 java.lang.String body)
      • RawField

        public RawField​(java.lang.String name,
                        java.lang.String body)
    • Method Detail

      • isSpace

        private static boolean isSpace​(java.lang.String body,
                                       int pos)
      • getRaw

        public ByteSequence getRaw()
        Description copied from interface: Field
        Gets original (raw) representation of the field, if available, null otherwise.
        Specified by:
        getRaw in interface Field
      • getName

        public java.lang.String getName()
        Description copied from interface: Field
        Returns the name of the field.
        Specified by:
        getName in interface Field
      • getNameLowerCase

        public java.lang.String getNameLowerCase()
        Description copied from interface: Field
        Returns the name of the field in lower case.
        Specified by:
        getNameLowerCase in interface Field
      • getBody

        public java.lang.String getBody()
        Description copied from interface: Field
        Gets the unparsed and possibly encoded (see RFC 2047) field body string.
        Specified by:
        getBody in interface Field
        Returns:
        the unparsed field body string.
      • getDelimiterIdx

        public int getDelimiterIdx()
      • toString

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