package org.jsmpp.bean;

/**
 * @author uudashr
 * 
 */
public enum GSMSpecificFeature {

    // TODO uudashr: complete the specific feature
    DEFAULT((byte) 0x00), 
    /**
     * User data header indicator.
     */
    UDHI((byte) 0xc0);

    public static final byte CLEAR_BYTE = 0x3f;
    public static final byte MASK_BYTE = (byte) 0xc0;

    private final byte value;

    private GSMSpecificFeature(byte value) {
        this.value = value;
    }

    public byte value() {
        return value;
    }
    
    public boolean containedIn(ESMClass esmClass) {
        return containedIn(esmClass.value());
    }
    
    public boolean containedIn(byte esmClass) {
        return this.value == (byte)(esmClass & MASK_BYTE);
    }
    
    public static byte compose(byte esmClass, GSMSpecificFeature specificFeature) {
        return (byte)(clean(esmClass) | specificFeature.value());
    }
    
    public static byte clean(byte esmClass) {
        return (byte) (esmClass & CLEAR_BYTE);
    }
}

@@ -86,85 +86,183 @@
 e %7B%0A
-%0A    // TODO uudashr: complete the specific feature%0A    DEFAULT
+    DEFAULT((byte) 0x00),%0A    %0A    /**%0A     * User data header indicator.%0A     */%0A    UDHI((byte)0x40), %0A    %0A    /**%0A     * Reply path.%0A     */%0A    REPLYPATH
 ((byte)
- 
 0x
-0
+8
 0),
+%0A   
  %0A  
@@ -292,32 +292,47 @@
 header indicator
+ and Reply path
 .%0A     */%0A    UD
@@ -329,24 +329,34 @@
  */%0A    UDHI
+_REPLYPATH
 ((byte) 0xc0
@@ -640,230 +640,932 @@
     
-public boolean containedIn(ESMClass esmClass) %7B%0A        return containedIn(esmClass.value());%0A    %7D%0A    %0A    public boolean containedIn(byte esmClass) %7B%0A        return this.value == (byte)(esmClass & MASK_BYTE);%0A    %7D
+/**%0A     * Check the GSM Specific Feature is contained in ESM class value.%0A     * %0A     * @param esmClass is the ESM class.%0A     * @return %3Ctt%3Etrue%3C/tt%3E if the GSM specific feature is contained in ESM class.%0A     */%0A    public boolean containedIn(ESMClass esmClass) %7B%0A        return containedIn(esmClass.value());%0A    %7D%0A    %0A    /**%0A     * Check the GSM Specific Feature is contained in ESM class value.%0A     * %0A     * @param esmClass is the ESM class.%0A     * @return %3Ctt%3Etrue%3C/tt%3E if the GSM specific feature is contained in ESM class.%0A     */%0A    public boolean containedIn(byte esmClass) %7B%0A        return this.value == clear(esmClass);%0A    %7D%0A    %0A    /**%0A     * Compose the existing ESM class with the GSM specific feature.%0A     * %0A     * @param esmClass is the existing ESM class.%0A     * @param specificFeature the GSM specific feature.%0A     * @return the ESM class composed with specified GSM specific feature. 
 %0A    
+ */
 %0A   
@@ -1671,17 +1671,17 @@
 te)(clea
-n
+r
 (esmClas
@@ -1718,24 +1718,170 @@
 %0A    %7D%0A    %0A
+    /**%0A     * Clear the bit 0 - 6.%0A     * %0A     * @param esmClass is the ESM class value.%0A     * @return the masked value for ESM class.%0A     */%0A
     public s
@@ -1895,17 +1895,17 @@
 yte clea
-n
+r
 (byte es
@@ -1935,17 +1935,16 @@
 n (byte)
- 
 (esmClas

Fix and complete the features