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

com.floragunn.searchguard.sgconf.impl.v6.InternalUserV6 Maven / Gradle / Ivy

The newest version!
package com.floragunn.searchguard.sgconf.impl.v6;

import java.util.Collections;
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.floragunn.searchguard.sgconf.Hashed;
import com.floragunn.searchguard.sgconf.Hideable;

public class InternalUserV6 implements Hideable, Hashed {
        
        private String hash;
        private boolean readonly;
        private boolean hidden;
        private List roles = Collections.emptyList();
        private Map attributes = Collections.emptyMap();
        private String username;

        

        public InternalUserV6(String hash, boolean readonly, boolean hidden, List roles, Map attributes, String username) {
            super();
            this.hash = hash;
            this.readonly = readonly;
            this.hidden = hidden;
            this.roles = roles;
            this.attributes = attributes;
            this.username = username;
        }

        public String getUsername() {
            return username;
        }

        public void setUsername(String username) {
            this.username = username;
        }

        public InternalUserV6() {
            super();
            //default constructor
        }
        
        public String getHash() {
            return hash;
        }
        public void setHash(String hash) {
            this.hash = hash;
        }
        public boolean isReadonly() {
            return readonly;
        }
        public void setReadonly(boolean readonly) {
            this.readonly = readonly;
        }
        public boolean isHidden() {
            return hidden;
        }
        public void setHidden(boolean hidden) {
            this.hidden = hidden;
        }
        public List getRoles() {
            return roles;
        }
        public void setRoles(List roles) {
            this.roles = roles;
        }
        public Map getAttributes() {
            return attributes;
        }
        public void setAttributes(Map attributes) {
            this.attributes = attributes;
        }

        @Override
        public String toString() {
            return "SgInternalUser [hash=" + hash + ", readonly=" + readonly + ", hidden=" + hidden + ", roles=" + roles + ", attributes="
                    + attributes + "]";
        }
        
        @JsonIgnore
        public boolean isReserved() {
            return readonly;
        }

        @Override
        @JsonIgnore
        public void clearHash() {
            hash = "";
        }
        
        

    }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy