directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r234465 [2/2] - /directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/
Date Mon, 22 Aug 2005 10:20:51 GMT
Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/TicketFlags.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/TicketFlags.java?rev=234465&r1=234464&r2=234465&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/TicketFlags.java
(original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/TicketFlags.java
Mon Aug 22 03:20:30 2005
@@ -16,7 +16,8 @@
  */
 package org.apache.kerberos.messages.value;
 
-public class TicketFlags extends Options {
+public class TicketFlags extends Options
+{
 	// Ticket flag - reserved
 	public static final int RESERVED                 = 0;
 	// Ticket flag - forwardable
@@ -45,54 +46,96 @@
 	public static final int TRANSITED_POLICY_CHECKED = 12;
 	// Ticket flag - OK as delegate
 	public static final int OK_AS_DELEGATE           = 13;
-	
+
 	// Ticket flag - maximum value
 	public static final int MAX_VALUE                = 32;
 
 	/**
-	 * Class constructor
-	 */
-	public TicketFlags() {
-		super(MAX_VALUE);
-	}
-	
-	public TicketFlags(byte[] options) {
-		super(MAX_VALUE);
-		setBytes(options);
-	}
+     * Class constructor
+     */
+    public TicketFlags()
+    {
+        super( MAX_VALUE );
+    }
 
-	/**
-	 * Converts the object to a printable string
-	 */
-	public String toString() {
-		StringBuffer result = new StringBuffer();
-		if (get(FORWARDABLE))
-			result.append("FORWARDABLE ");
-		if (get(FORWARDED))
-			result.append("FORWARDED ");
-		if (get(PROXIABLE))
-			result.append("PROXIABLE ");
-		if (get(PROXY))
-			result.append("PROXY ");
-		if (get(MAY_POSTDATE))
-			result.append("MAY_POSTDATE ");
-		if (get(POSTDATED))
-			result.append("POSTDATED ");
-		if (get(INVALID))
-			result.append("INVALID ");
-		if (get(RENEWABLE))
-			result.append("RENEWABLE ");
-		if (get(INITIAL))
-			result.append("INITIAL ");
-		if (get(PRE_AUTHENT))
-			result.append("PRE_AUTHENT ");
-		if (get(HW_AUTHENT))
-			result.append("HW_AUTHENT ");
-		if (get(TRANSITED_POLICY_CHECKED))
-			result.append("TRANSITED_POLICY_CHECKED ");
-		if (get(OK_AS_DELEGATE))
-			result.append("OPTS_OK_AS_DELEGATE ");
-		return result.toString().trim();
-	}
-}
+    public TicketFlags( byte[] options )
+    {
+        super( MAX_VALUE );
+        setBytes( options );
+    }
+
+    /**
+     * Converts the object to a printable string
+     */
+    public String toString()
+    {
+        StringBuffer result = new StringBuffer();
+
+        if ( get( FORWARDABLE ) )
+        {
+            result.append( "FORWARDABLE " );
+        }
+
+        if ( get( FORWARDED ) )
+        {
+            result.append( "FORWARDED " );
+        }
+
+        if ( get( PROXIABLE ) )
+        {
+            result.append( "PROXIABLE " );
+        }
+
+        if ( get( PROXY ) )
+        {
+            result.append( "PROXY " );
+        }
+
+        if ( get( MAY_POSTDATE ) )
+        {
+            result.append( "MAY_POSTDATE " );
+        }
 
+        if ( get( POSTDATED ) )
+        {
+            result.append( "POSTDATED " );
+        }
+
+        if ( get( INVALID ) )
+        {
+            result.append( "INVALID " );
+        }
+
+        if ( get( RENEWABLE ) )
+        {
+            result.append( "RENEWABLE " );
+        }
+
+        if ( get( INITIAL ) )
+        {
+            result.append( "INITIAL " );
+        }
+
+        if ( get( PRE_AUTHENT ) )
+        {
+            result.append( "PRE_AUTHENT " );
+        }
+
+        if ( get( HW_AUTHENT ) )
+        {
+            result.append( "HW_AUTHENT " );
+        }
+
+        if ( get( TRANSITED_POLICY_CHECKED ) )
+        {
+            result.append( "TRANSITED_POLICY_CHECKED " );
+        }
+
+        if ( get( OK_AS_DELEGATE ) )
+        {
+            result.append( "OPTS_OK_AS_DELEGATE " );
+        }
+
+        return result.toString().trim();
+    }
+}

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/TransitedEncoding.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/TransitedEncoding.java?rev=234465&r1=234464&r2=234465&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/TransitedEncoding.java
(original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/TransitedEncoding.java
Mon Aug 22 03:20:30 2005
@@ -16,26 +16,30 @@
  */
 package org.apache.kerberos.messages.value;
 
-public class TransitedEncoding {
-	
-	private TransitedEncodingType _type;
-	private byte[]                _contents;
-	
-	public TransitedEncoding() {
-		_type = TransitedEncodingType.NULL;
-		_contents = new byte[0];
-	}
-	
-	public TransitedEncoding(TransitedEncodingType type, byte[] contents) {
-		_type     = type;
-		_contents = contents;
-	}
-	
-	public byte[] getContents() {
-		return _contents;
-	}
-	public TransitedEncodingType getType() {
-		return _type;
-	}
-}
+public class TransitedEncoding
+{
+    private TransitedEncodingType type;
+    private byte[] contents;
+
+    public TransitedEncoding()
+    {
+        type = TransitedEncodingType.NULL;
+        contents = new byte[ 0 ];
+    }
+
+    public TransitedEncoding( TransitedEncodingType type, byte[] contents )
+    {
+        this.type = type;
+        this.contents = contents;
+    }
 
+    public byte[] getContents()
+    {
+        return contents;
+    }
+
+    public TransitedEncodingType getType()
+    {
+        return type;
+    }
+}

Modified: directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/TransitedEncodingType.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/TransitedEncodingType.java?rev=234465&r1=234464&r2=234465&view=diff
==============================================================================
--- directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/TransitedEncodingType.java
(original)
+++ directory/shared/kerberos/branches/refactor-to-chain/common/src/java/org/apache/kerberos/messages/value/TransitedEncodingType.java
Mon Aug 22 03:20:30 2005
@@ -16,53 +16,64 @@
  */
 package org.apache.kerberos.messages.value;
 
-import java.util.*;
-
-public final class TransitedEncodingType implements Comparable {
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
 
+public final class TransitedEncodingType implements Comparable
+{
 	/**
 	 * Enumeration elements are constructed once upon class loading.
 	 * Order of appearance here determines the order of compareTo.
 	 */
 	public static final TransitedEncodingType NULL                 = new TransitedEncodingType(0,
"null");
 	public static final TransitedEncodingType DOMAIN_X500_COMPRESS = new TransitedEncodingType(1,
"Domain X500 compress");
-	
-	public String toString() {
-		return _fName + " (" + _fOrdinal + ")";
-	}
-
-	public int compareTo(Object that) {
-		return _fOrdinal - ((TransitedEncodingType) that)._fOrdinal;
-	}
-
-	public static TransitedEncodingType getTypeByOrdinal(int type) {
-		for (int i = 0; i < fValues.length; i++)
-			if (fValues[i]._fOrdinal == type)
-				return fValues[i];
-		return NULL;
-	}
-	
-	public int getOrdinal() {
-		return _fOrdinal;
-	}
-
-	/// PRIVATE /////
-	private final String _fName;
-	private final int    _fOrdinal;
-
-	/**
-	 * Private constructor prevents construction outside of this class.
-	 */
-	private TransitedEncodingType(int ordinal, String name) {
-		_fOrdinal = ordinal;
-		_fName    = name;
-	}
 
-	/**
-	 * These two lines are all that's necessary to export a List of VALUES.
-	 */
-	private static final TransitedEncodingType[] fValues = {NULL, DOMAIN_X500_COMPRESS};
-	// VALUES needs to be located here, otherwise illegal forward reference
-	public static final List VALUES = Collections.unmodifiableList(Arrays.asList(fValues));
+	public String toString()
+    {
+        return name + " (" + ordinal + ")";
+    }
+
+    public int compareTo( Object that )
+    {
+        return ordinal - ( (TransitedEncodingType) that ).ordinal;
+    }
+
+    public static TransitedEncodingType getTypeByOrdinal( int type )
+    {
+        for ( int ii = 0; ii < values.length; ii++ )
+        {
+            if ( values[ ii ].ordinal == type )
+            {
+                return values[ ii ];
+            }
+        }
+        
+        return NULL;
+    }
+
+    public int getOrdinal()
+    {
+        return ordinal;
+    }
+
+    /// PRIVATE /////
+    private final String name;
+    private final int ordinal;
+
+    /**
+     * Private constructor prevents construction outside of this class.
+     */
+    private TransitedEncodingType( int ordinal, String name )
+    {
+        this.ordinal = ordinal;
+        this.name = name;
+    }
+
+    /**
+     * These two lines are all that's necessary to export a List of VALUES.
+     */
+    private static final TransitedEncodingType[] values = { NULL, DOMAIN_X500_COMPRESS };
+    // VALUES needs to be located here, otherwise illegal forward reference
+    public static final List VALUES = Collections.unmodifiableList( Arrays.asList( values
) );
 }
-



Mime
View raw message