statoolinfosweb/src/fr/devinsy/statoolinfos/core/Organization.java

135 lines
2.9 KiB
Java

/*
* Copyright (C) 2020 Christian Pierre MOMON <christian@momon.org>
*
* This file is part of StatoolInfos, simple service statistics tool.
*
* StatoolInfos is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* StatoolInfos is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with StatoolInfos. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.devinsy.statoolinfos.core;
import java.io.File;
import org.apache.commons.lang3.StringUtils;
import fr.devinsy.statoolinfos.properties.PathProperties;
import fr.devinsy.statoolinfos.properties.PathPropertyList;
/**
* The Class PathProperty.
*/
public class Organization extends PathPropertyList
{
private static final long serialVersionUID = -2709210934548224213L;
private Services services;
private File localFile;
/**
* Instantiates a new organization.
*/
public Organization()
{
super();
this.services = new Services();
}
/**
* Instantiates a new organization.
*
* @param properties
* the properties
*/
public Organization(final PathProperties properties)
{
super(properties);
if ((properties == null) || (StringUtils.isBlank(properties.get("organization.name"))))
{
throw new IllegalArgumentException("Not an organization.");
}
else
{
this.services = new Services();
}
}
public String getDescription()
{
String result;
result = get("organization.description");
//
return result;
}
public File getLocalFile()
{
return this.localFile;
}
/**
* Gets the name.
*
* @return the name
*/
public String getName()
{
String result;
result = get("organization.name");
//
return result;
}
public Services getServices()
{
return this.services;
}
/**
* Gets the technical name.
*
* @return the technical name
*/
public String getTechnicalName()
{
String result;
result = StatoolInfosUtils.buildTechnicalName(getName());
//
return result;
}
/**
* Gets the website.
*
* @return the website
*/
public String getWebsite()
{
String result;
result = get("organization.website");
//
return result;
}
public void setLocalFile(final File localFile)
{
this.localFile = localFile;
}
}