@Override public Token createEmptyAuthToken() { return new Token(); }
public Object getFieldValue(_Fields field) { switch (field) { case VALUE: return getValue(); } throw new IllegalStateException(); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof Token) return this.equals((Token)that); return false; }
public void setFieldValue(_Fields field, Object value) { switch (field) { case VALUE: if (value == null) { unsetValue(); } else { setValue((String)value); } break; } }
public void validate() throws org.apache.thrift.TException { // check for required fields if (!isSetValue()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'value' is unset! Struct:" + toString()); } // check for sub-struct validity }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, greet_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.token = new Token(); struct.token.read(iprot); struct.setTokenIsSet(true); } } }
public void read(org.apache.thrift.protocol.TProtocol iprot, Token struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // VALUE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.value = iprot.readString(); struct.setValueIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); struct.validate(); }
/** * Performs a deep copy on <i>other</i>. */ public Token(Token other) { if (other.isSetValue()) { this.value = other.value; } }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, Token struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.value = iprot.readString(); struct.setValueIsSet(true); } }
public void read(org.apache.thrift.protocol.TProtocol iprot, greet_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // TOKEN if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.token = new Token(); struct.token.read(iprot); struct.setTokenIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); struct.validate(); }
public boolean equals(Token that) { if (that == null) return false; boolean this_present_value = true && this.isSetValue(); boolean that_present_value = true && that.isSetValue(); if (this_present_value || that_present_value) { if (!(this_present_value && that_present_value)) return false; if (!this.value.equals(that.value)) return false; } return true; }
public Token deepCopy() { return new Token(this); }
@Override public TName process(Token authToken) throws TException { if (authToken.getValue().equals("heisours")) { return new TName("John", "Smith"); } throw new UnauthorizedException(ErrorCode.WRONG_LOGIN_OR_PASSWORD); } };
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case VALUE: return isSetValue(); } throw new IllegalStateException(); }
public boolean equals(greet_args that) { if (that == null) return false; boolean this_present_token = true && this.isSetToken(); boolean that_present_token = true && that.isSetToken(); if (this_present_token || that_present_token) { if (!(this_present_token && that_present_token)) return false; if (!this.token.equals(that.token)) return false; } return true; }
/** * Performs a deep copy on <i>other</i>. */ public greet_args(greet_args other) { if (other.isSetToken()) { this.token = new Token(other.token); } }
@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_value = true && (isSetValue()); list.add(present_value); if (present_value) list.add(value); return list.hashCode(); }
public void testUnauthorizedCall() throws Exception { client.greet(new Token("heisnot")); } }
@Override public int compareTo(Token other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); if (lastComparison != 0) { return lastComparison; } if (isSetValue()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); if (lastComparison != 0) { return lastComparison; } } return 0; }