Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.enragedginger.stephenerialization.preprocessing;

Represents a stephenerializable field. This class is intended for use doing preprocessing where reflection on the parent class is not yet available. This instances of this class will sort by version, order, fieldname (in that order). Other fields are not considered for compareTo and equals.

Author(s):
Stephen Hopper
 
 
     private int version;
     private int order;
     private String fieldName;
     private String getterName;
     private String setterName;
     private String fieldTypeName;
     private String objectInputStreamMethod;
     private String objectOutputStreamMethod;
     private boolean isPrimitive;
 
     public int getVersion() {
         return ;
     }
 
     public void setVersion(int version) {
         this. = version;
     }
 
     public int getOrder() {
         return ;
     }
 
     public void setOrder(int order) {
         this. = order;
     }
 
     public String getFieldName() {
         return ;
     }
 
     public void setFieldName(String fieldName) {
         this. = fieldName;
     }
 
     public String getGetterName() {
         return ;
     }
 
     public void setGetterName(String getterName) {
         this. = getterName;
     }
 
     public String getSetterName() {
         return ;
     }
 
     public void setSetterName(String setterName) {
         this. = setterName;
     }
 
     public String getFieldTypeName() {
         return ;
     }
 
     public void setFieldTypeName(String fieldTypeName) {
         this. = fieldTypeName;
     }
 
     public String getObjectInputStreamMethod() {
         return ;
     }
 
     public void setObjectInputStreamMethod(String objectInputStreamMethod) {
         this. = objectInputStreamMethod;
     }
 
     public boolean isPrimitive() {
         return ;
     }
 
     public void setPrimitive(boolean isPrimitive) {
         this. = isPrimitive;
     }
 
     public String getObjectOutputStreamMethod() {
         return ;
     }
 
     public void setObjectOutputStreamMethod(String objectOutputStreamMethod) {
         this. = objectOutputStreamMethod;
     }

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

    
    public int compareTo(StephenerializationPreprocessorField other) {
        int value = 0;
        if (other != null) {
            if (this. != other.version) {
                value = ((Integerthis.).compareTo(other.version);
            } else if (this. != other.order) {
                value = ((Integerthis.).compareTo(other.order);
            } else if (this. != null) {
                value = this..compareTo(other.fieldName);
            } else {
                value = 1;
            }
        }
        return value;
    }
New to GrepCode? Check out our FAQ X