org.ligoj.app.iam.CompanyOrg Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plugin-api Show documentation
Show all versions of plugin-api Show documentation
Plugin API definition and compatibility following semver
The newest version!
/*
* Licensed under MIT (https://github.com/ligoj/ligoj/blob/master/LICENSE)
*/
package org.ligoj.app.iam;
import java.util.ArrayList;
import java.util.List;
import javax.naming.ldap.LdapName;
import lombok.Getter;
import lombok.Setter;
/**
* An organizational company.
*/
@Getter
@Setter
public class CompanyOrg extends ContainerOrg {
/**
* SID
*/
private static final long serialVersionUID = 1L;
/**
* This company and the parents.
*/
private List companyTree = new ArrayList<>();
/**
* LDAP Name. Is null
while not computed.
*/
private LdapName ldapName;
/**
* All arguments constructor.
*
* @param dn Corresponds to the "Distinguished Name". Will be saved in "description".
* @param name "name" corresponds to the "Organizational Unit". Will be saved in "name", and in "id" in is
* normalized form.
*/
public CompanyOrg(final String dn, final String name) {
super(dn, name);
companyTree.add(this);
}
@Override
public boolean equals(final Object other) {
return other instanceof CompanyOrg org && getId().equals(org.getId());
}
@Override
public int hashCode() {
return getId().hashCode();
}
}