@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ( ( fieldName == null ) ? 0 : fieldName.hashCode() ); result = prime * result + ( ( type == null ) ? 0 : type.hashCode() ); result = prime * result + ( ( value == null ) ? 0 : value.hashCode() ); return result; }
public static SingularTermDeletionQuery fromString(String[] string) { if ( string.length != 3 ) { throw new IllegalArgumentException( "To instantiate a SingularTermDeletionQuery, an array of size 3 is required" + " (type, fieldName, value). Got an array of size " + string.length ); } Type type = Type.valueOf( string[0] ); switch ( type ) { case STRING: return new SingularTermDeletionQuery( string[1], string[2] ); case INT: return new SingularTermDeletionQuery( string[1], Integer.parseInt( string[2] ) ); case FLOAT: return new SingularTermDeletionQuery( string[1], Float.parseFloat( string[2] ) ); case LONG: return new SingularTermDeletionQuery( string[1], Long.parseLong( string[2] ) ); case DOUBLE: return new SingularTermDeletionQuery( string[1], Double.parseDouble( string[2] ) ); default: throw new AssertionFailure( "Unsupported value type: " + type ); } }
public static SingularTermDeletionQuery fromString(String[] string) { if ( string.length != 3 ) { throw new IllegalArgumentException( "To instantiate a SingularTermDeletionQuery, an array of size 3 is required" + " (type, fieldName, value). Got an array of size " + string.length ); } Type type = Type.valueOf( string[0] ); switch ( type ) { case STRING: return new SingularTermDeletionQuery( string[1], string[2] ); case INT: return new SingularTermDeletionQuery( string[1], Integer.parseInt( string[2] ) ); case FLOAT: return new SingularTermDeletionQuery( string[1], Float.parseFloat( string[2] ) ); case LONG: return new SingularTermDeletionQuery( string[1], Long.parseLong( string[2] ) ); case DOUBLE: return new SingularTermDeletionQuery( string[1], Double.parseDouble( string[2] ) ); default: throw new AssertionFailure( "Unsupported value type: " + type ); } }
@Override public String[] serialize() { return new String[] { this.getType().toString(), this.getFieldName(), String.valueOf( this.getValue() ) }; }
@Override public String[] serialize() { return new String[] { this.getType().toString(), this.getFieldName(), String.valueOf( this.getValue() ) }; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ( ( fieldName == null ) ? 0 : fieldName.hashCode() ); result = prime * result + ( ( type == null ) ? 0 : type.hashCode() ); result = prime * result + ( ( value == null ) ? 0 : value.hashCode() ); return result; }