public ILicenseFamily build()

in apache-rat-core/src/main/java/org/apache/rat/license/ILicenseFamily.java [115:156]


        public ILicenseFamily build() {
            if (StringUtils.isBlank(licenseFamilyCategory)) {
                throw new ConfigurationException("LicenseFamily Category must be specified");
            }
            if (StringUtils.isBlank(licenseFamilyName)) {
                throw new ConfigurationException("LicenseFamily Name must be specified");
            }
            return new ILicenseFamily() {
                private final String cat = ILicenseFamily.makeCategory(licenseFamilyCategory);
                private final String name = licenseFamilyName;
                @Override
                public String toString() {
                    return String.format("%s %s", getFamilyCategory(), getFamilyName());
                }

                @Override
                public String getFamilyName() {
                    return name;
                }

                @Override
                public String getFamilyCategory() {
                    return cat;
                }

                @Override
                public boolean equals(final Object other) {
                    if (other == this) {
                        return true;
                    }
                    if (other instanceof ILicenseFamily) {
                        return this.getFamilyCategory().equals(((ILicenseFamily) other).getFamilyCategory());
                    }
                    return false;
                }

                @Override
                public int hashCode() {
                    return getFamilyCategory().hashCode();
                }
            };
        }