/** 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 java.lang.IllegalArgumentException(); } switch (field) { case CREDS: return is_set_creds(); case TOPO_OWNER: return is_set_topoOwner(); } throw new java.lang.IllegalStateException(); }
/** * Performs a deep copy on <i>other</i>. */ public Credentials(Credentials other) { if (other.is_set_creds()) { java.util.Map<java.lang.String,java.lang.String> __this__creds = new java.util.HashMap<java.lang.String,java.lang.String>(other.creds); this.creds = __this__creds; } if (other.is_set_topoOwner()) { this.topoOwner = other.topoOwner; } }
@Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((is_set_creds()) ? 131071 : 524287); if (is_set_creds()) hashCode = hashCode * 8191 + creds.hashCode(); hashCode = hashCode * 8191 + ((is_set_topoOwner()) ? 131071 : 524287); if (is_set_topoOwner()) hashCode = hashCode * 8191 + topoOwner.hashCode(); return hashCode; }
@Override public java.lang.String toString() { java.lang.StringBuilder sb = new java.lang.StringBuilder("Credentials("); boolean first = true; sb.append("creds:"); if (this.creds == null) { sb.append("null"); } else { sb.append(this.creds); } first = false; if (is_set_topoOwner()) { if (!first) sb.append(", "); sb.append("topoOwner:"); if (this.topoOwner == null) { sb.append("null"); } else { sb.append(this.topoOwner); } first = false; } sb.append(")"); return sb.toString(); }
public boolean equals(Credentials that) { if (that == null) return false; if (this == that) return true; boolean this_present_creds = true && this.is_set_creds(); boolean that_present_creds = true && that.is_set_creds(); if (this_present_creds || that_present_creds) { if (!(this_present_creds && that_present_creds)) return false; if (!this.creds.equals(that.creds)) return false; } boolean this_present_topoOwner = true && this.is_set_topoOwner(); boolean that_present_topoOwner = true && that.is_set_topoOwner(); if (this_present_topoOwner || that_present_topoOwner) { if (!(this_present_topoOwner && that_present_topoOwner)) return false; if (!this.topoOwner.equals(that.topoOwner)) return false; } return true; }
@Override public int compareTo(Credentials other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = java.lang.Boolean.valueOf(is_set_creds()).compareTo(other.is_set_creds()); if (lastComparison != 0) { return lastComparison; } if (is_set_creds()) { lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.creds, other.creds); if (lastComparison != 0) { return lastComparison; } } lastComparison = java.lang.Boolean.valueOf(is_set_topoOwner()).compareTo(other.is_set_topoOwner()); if (lastComparison != 0) { return lastComparison; } if (is_set_topoOwner()) { lastComparison = org.apache.storm.thrift.TBaseHelper.compareTo(this.topoOwner, other.topoOwner); if (lastComparison != 0) { return lastComparison; } } return 0; }
@Override public void write(org.apache.storm.thrift.protocol.TProtocol prot, Credentials struct) throws org.apache.storm.thrift.TException { org.apache.storm.thrift.protocol.TTupleProtocol oprot = (org.apache.storm.thrift.protocol.TTupleProtocol) prot; { oprot.writeI32(struct.creds.size()); for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter601 : struct.creds.entrySet()) { oprot.writeString(_iter601.getKey()); oprot.writeString(_iter601.getValue()); } } java.util.BitSet optionals = new java.util.BitSet(); if (struct.is_set_topoOwner()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.is_set_topoOwner()) { oprot.writeString(struct.topoOwner); } }
String realUser = (String) topoConf.get(Config.TOPOLOGY_SUBMITTER_USER); String expectedOwner = null; if (credentials.is_set_topoOwner()) { expectedOwner = credentials.get_topoOwner(); } else {
public void write(org.apache.storm.thrift.protocol.TProtocol oprot, Credentials struct) throws org.apache.storm.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.creds != null) { oprot.writeFieldBegin(CREDS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.storm.thrift.protocol.TMap(org.apache.storm.thrift.protocol.TType.STRING, org.apache.storm.thrift.protocol.TType.STRING, struct.creds.size())); for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter600 : struct.creds.entrySet()) { oprot.writeString(_iter600.getKey()); oprot.writeString(_iter600.getValue()); } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } if (struct.topoOwner != null) { if (struct.is_set_topoOwner()) { oprot.writeFieldBegin(TOPO_OWNER_FIELD_DESC); oprot.writeString(struct.topoOwner); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }