Skip to content

Commit

Permalink
Remove unused builder from PrincipalPrivileges
Browse files Browse the repository at this point in the history
  • Loading branch information
wagnermarkd authored and dain committed Aug 31, 2018
1 parent a36724f commit 110a27d
Showing 1 changed file with 0 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*/
package com.facebook.presto.hive.metastore;

import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ImmutableSetMultimap;
import com.google.common.collect.Multimap;
import com.google.common.collect.SetMultimap;
Expand Down Expand Up @@ -42,54 +41,4 @@ public SetMultimap<String, HivePrivilegeInfo> getRolePrivileges()
{
return rolePrivileges;
}

public static Builder builder()
{
return new Builder();
}

public static Builder builder(PrincipalPrivileges table)
{
return new Builder(table);
}

public static class Builder
{
private Multimap<String, HivePrivilegeInfo> userPrivileges = ArrayListMultimap.create();
private Multimap<String, HivePrivilegeInfo> rolePrivileges = ArrayListMultimap.create();

public Builder()
{
}

public Builder(PrincipalPrivileges principalPrivileges)
{
userPrivileges.putAll(principalPrivileges.getUserPrivileges());
rolePrivileges.putAll(principalPrivileges.getRolePrivileges());
}

public Builder setUserPrivileges(Multimap<String, HivePrivilegeInfo> userPrivileges)
{
this.userPrivileges = ArrayListMultimap.create(userPrivileges);
return this;
}

public Builder addUserPriviledge(String userName, HivePrivilegeInfo privilege)
{
userPrivileges.put(userName, privilege);
return this;
}

public Builder setRolePrivileges(Multimap<String, HivePrivilegeInfo> rolePrivileges)
{
this.rolePrivileges = ArrayListMultimap.create(rolePrivileges);
return this;
}

public Builder addRolePriviledge(String roleName, HivePrivilegeInfo privilege)
{
rolePrivileges.put(roleName, privilege);
return this;
}
}
}

0 comments on commit 110a27d

Please sign in to comment.