82 lines
1.7 KiB
Java
82 lines
1.7 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 org.apache.commons.lang3.StringUtils;
|
||
|
|
||
|
/**
|
||
|
* The Class PathProperty.
|
||
|
*/
|
||
|
public class PathProperty
|
||
|
{
|
||
|
private String path;
|
||
|
private String value;
|
||
|
|
||
|
/**
|
||
|
* Instantiates a new path property.
|
||
|
*
|
||
|
* @param path
|
||
|
* the key
|
||
|
* @param value
|
||
|
* the value
|
||
|
*/
|
||
|
public PathProperty(final String path, final String value)
|
||
|
{
|
||
|
if (StringUtils.isAllBlank(path))
|
||
|
{
|
||
|
throw new IllegalArgumentException("Path is blank.");
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
this.path = path;
|
||
|
this.value = value;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public String getLeaf()
|
||
|
{
|
||
|
String result;
|
||
|
|
||
|
result = this.path.substring(this.path.lastIndexOf('.') + 1);
|
||
|
|
||
|
//
|
||
|
return result;
|
||
|
}
|
||
|
|
||
|
public String getPath()
|
||
|
{
|
||
|
return this.path;
|
||
|
}
|
||
|
|
||
|
public String getValue()
|
||
|
{
|
||
|
return this.value;
|
||
|
}
|
||
|
|
||
|
public void setPath(final String path)
|
||
|
{
|
||
|
this.path = path;
|
||
|
}
|
||
|
|
||
|
public void setValue(final String value)
|
||
|
{
|
||
|
this.value = value;
|
||
|
}
|
||
|
}
|