All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.tiogasolutions.dev.domain.account.Permissions Maven / Gradle / Ivy

There is a newer version: 4.2.9
Show newest version
package org.tiogasolutions.dev.domain.account;

import java.io.Serializable;
import java.util.*;

public class Permissions implements Serializable {

  private static final long serialVersionUID = 1L;

  private Set roleTypes = new TreeSet<>();

  public Permissions() {
  }

  public Permissions(Collection roleTypes) {
    if (roleTypes != null) {
      this.roleTypes.addAll(roleTypes);
    }
  }

  public Set getRoleTypes() {
    return Collections.unmodifiableSet(roleTypes);
  }

  public void setRoleTypes(Set roleTypes) {
    this.roleTypes.clear();
    this.roleTypes.addAll(roleTypes);
  }

  public boolean contains(String roleType) {
    return roleTypes.contains(roleType);
  }

  public boolean addRoleType(String roleType) {
    return roleTypes.add(roleType);
  }

  public boolean removeRoleType(String roleType) {
    return roleTypes.remove(roleType);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy