@Override
  public int compareTo(HivePrivilegeObject o) {
    int compare = type.compareTo(o.type);
    if (compare == 0) {
      compare = dbname != null ?
          (o.dbname != null ? dbname.compareTo(o.dbname) : 1) :
          (o.dbname != null ? -1 : 0);
    }
    if (compare == 0) {
      compare = objectName != null ?
          (o.objectName != null ? objectName.compareTo(o.objectName) : 1) :
          (o.objectName != null ? -1 : 0);
    }
    if (compare == 0) {
      compare = partKeys != null ?
          (o.partKeys != null ? compare(partKeys, o.partKeys) : 1) :
          (o.partKeys != null ? -1 : 0);
    }
    if (compare == 0) {
      compare = columns != null ?
          (o.columns != null ? compare(columns, o.columns) : 1) :
          (o.columns != null ? -1 : 0);
    }
    if (compare == 0) {
      compare = className != null ?
          (o.className != null ? className.compareTo(o.className) : 1) :
          (o.className != null ? -1 : 0);
    }
    if (compare == 0) {
      compare = ownerName != null?
          (o.ownerName != null ? ownerName.compareTo(o.ownerName) : 1) :
          (o.ownerName != null ? -1 : 0);
    }
    if (compare == 0) {
      compare = ownerType != null?
          (o.ownerType != null ? ownerType.compareTo(o.ownerType) : 1) :
          (o.ownerType != null ? -1 : 0);
    }

    return compare;
  }
Represents the object on which privilege is being granted/revoked, and objects
being used in queries.

Check the get* function documentation for information on what value it returns based on
the {@link HivePrivilegeObjectType}.
ql/src/java/org/apache/hadoop/hive/ql/security/authorization/plugin/HivePrivilegeObject.java