Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2012 Stephen M. Hopper Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 package com.enragedginger.stephenerialization.fields;
 
Represents a field which is stephenerializable.

Author(s):
Stephen Hopper
 
 	
 	private Field field;
 	private int version;
 	private int order;
 	private int subClassLevel;

Returns:
the field
 
 	public Field getField() {
 		return ;
 	}

Parameters:
field the field to set
 
 	public void setField(Field field) {
 		this. = field;
 	}

Returns:
the version
 
 	public int getVersion() {
 		return ;
 	}

Parameters:
version the version to set
 
 	public void setVersion(int version) {
 		this. = version;
 	}

Returns:
the order
 
 	public int getOrder() {
 		return ;
 	}

Parameters:
order the order to set
 
 	public void setOrder(int order) {
 		this. = order;
 	}

Returns:
the subClassLevel
 
 	public int getSubClassLevel() {
 		return ;
 	}

Parameters:
subClassLevel the subClassLevel to set
 
 	public void setSubClassLevel(int subClassLevel) {
 		this. = subClassLevel;
 	}

 
 	public boolean equals(Object other) {
 		boolean equals = false;
 		if (other instanceof StephenerializableField) {
 			equals = this.compareTo(that) == 0;
 		}
 		return equals;
 	}

 
 	public int compareTo(StephenerializableField other) {
 		int value = 0;
 		if (other != null) {
 			if (this. != other.version) {
				value = ((Integerthis.).compareTo(other.version);
else if (this. != other.subClassLevel) {
				value = ((Integerthis.).compareTo(other.subClassLevel);
else if (this. != other.order) {
				value = ((Integerthis.).compareTo(other.order);
else if (this. != other.field) {
				if (this. != null) {
					value = this..getName().compareTo(other.field.getName());
else {
					value = 1;
				}
			}
		}
		return value;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		final StringBuilder builder = new StringBuilder();
		builder.append("StephenerializableField [field=");
		builder.append();
		builder.append(", version=");
		builder.append();
		builder.append(", order=");
		builder.append();
		builder.append(", subClassLevel=");
		builder.append("]");
		return builder.toString();
	}
New to GrepCode? Check out our FAQ X