public TAuthorizable deepCopy() { return new TAuthorizable(this); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof TAuthorizable) return this.equals((TAuthorizable)that); return false; }
for (int _i58 = 0; _i58 < _list56.size; ++_i58) _elem57 = new TAuthorizable(); _elem57.read(iprot); struct.oldAuthorizables.add(_elem57); for (int _i61 = 0; _i61 < _list59.size; ++_i61) _elem60 = new TAuthorizable(); _elem60.read(iprot); struct.newAuthorizables.add(_elem60);
public void validate() throws org.apache.thrift.TException { // check for required fields if (!isSetType()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'type' is unset! Struct:" + toString()); } if (!isSetName()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' is unset! Struct:" + toString()); } // check for sub-struct validity }
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.type = iprot.readString(); struct.setTypeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.name = iprot.readString(); struct.setNameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
@Override public String getTypeName() { return tAuthorizable.getType(); } @Override
@Override public String getName() { return tAuthorizable.getName(); } });
@Override public void read(org.apache.thrift.protocol.TProtocol prot, TAuthorizable struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.type = iprot.readString(); struct.setTypeIsSet(true); struct.name = iprot.readString(); struct.setNameIsSet(true); } }
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); } }
for (int _i42 = 0; _i42 < _list40.size; ++_i42) _elem41 = new TAuthorizable(); _elem41.read(iprot); struct.authorizables.add(_elem41);
/** 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 TYPE: return isSetType(); case NAME: return isSetName(); } throw new IllegalStateException(); }
private List<TAuthorizable> fromAuthorizable(List<? extends Authorizable> authorizables) { List<TAuthorizable> tAuthorizables = Lists.newArrayList(); for (Authorizable authorizable : authorizables) { tAuthorizables.add(new TAuthorizable(authorizable.getTypeName(), authorizable.getName())); } return tAuthorizables; }
for (int _i2 = 0; _i2 < _list0.size; ++_i2) _elem1 = new TAuthorizable(); _elem1.read(iprot); struct.authorizables.add(_elem1);
public String toString(TSentryPrivilege tSentryPrivilege) { List<String> privileges = Lists.newArrayList(); if (tSentryPrivilege != null) { List<TAuthorizable> authorizables = tSentryPrivilege.getAuthorizables(); String action = tSentryPrivilege.getAction(); String grantOption = (tSentryPrivilege.getGrantOption() == TSentryGrantOption.TRUE ? "true" : "false"); Iterator<TAuthorizable> it = authorizables.iterator(); if (it != null) { while (it.hasNext()) { TAuthorizable tAuthorizable = it.next(); privileges.add(SentryConstants.KV_JOINER.join( tAuthorizable.getType(), tAuthorizable.getName())); } } if (!authorizables.isEmpty()) { privileges.add(SentryConstants.KV_JOINER.join( PolicyFileConstants.PRIVILEGE_ACTION_NAME, action)); } // only append the grant option to privilege string if it's true if ("true".equals(grantOption)) { privileges.add(SentryConstants.KV_JOINER.join( PolicyFileConstants.PRIVILEGE_GRANT_OPTION_NAME, grantOption)); } } return SentryConstants.AUTHORIZABLE_JOINER.join(privileges); }
public boolean equals(TAuthorizable that) { if (that == null) return false; boolean this_present_type = true && this.isSetType(); boolean that_present_type = true && that.isSetType(); if (this_present_type || that_present_type) { if (!(this_present_type && that_present_type)) return false; if (!this.type.equals(that.type)) return false; } boolean this_present_name = true && this.isSetName(); boolean that_present_name = true && that.isSetName(); if (this_present_name || that_present_name) { if (!(this_present_name && that_present_name)) return false; if (!this.name.equals(that.name)) return false; } return true; }
/** * Performs a deep copy on <i>other</i>. */ public TRenamePrivilegesRequest(TRenamePrivilegesRequest other) { __isset_bitfield = other.__isset_bitfield; this.protocol_version = other.protocol_version; if (other.isSetRequestorUserName()) { this.requestorUserName = other.requestorUserName; } if (other.isSetComponent()) { this.component = other.component; } if (other.isSetServiceName()) { this.serviceName = other.serviceName; } if (other.isSetOldAuthorizables()) { List<TAuthorizable> __this__oldAuthorizables = new ArrayList<TAuthorizable>(other.oldAuthorizables.size()); for (TAuthorizable other_element : other.oldAuthorizables) { __this__oldAuthorizables.add(new TAuthorizable(other_element)); } this.oldAuthorizables = __this__oldAuthorizables; } if (other.isSetNewAuthorizables()) { List<TAuthorizable> __this__newAuthorizables = new ArrayList<TAuthorizable>(other.newAuthorizables.size()); for (TAuthorizable other_element : other.newAuthorizables) { __this__newAuthorizables.add(new TAuthorizable(other_element)); } this.newAuthorizables = __this__newAuthorizables; } }
for (int _i68 = 0; _i68 < _list66.size; ++_i68) _elem67 = new TAuthorizable(); _elem67.read(iprot); struct.oldAuthorizables.add(_elem67); for (int _i71 = 0; _i71 < _list69.size; ++_i71) _elem70 = new TAuthorizable(); _elem70.read(iprot); struct.newAuthorizables.add(_elem70);