106 lines
2.5 KiB
Java
106 lines
2.5 KiB
Java
/**
|
|
* Copyright (C) 2019-2021 Christian Pierre MOMON <cmomon@april.org>
|
|
*
|
|
* This file is part of (April) Hebdobot.
|
|
*
|
|
* Hebdobot 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.
|
|
*
|
|
* Hebdobot 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 Hebdobot. If not, see <http://www.gnu.org/licenses/>
|
|
*/
|
|
package org.april.hebdobot.privatebin;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
/**
|
|
* The Class PrivatebinSettings
|
|
*/
|
|
public class PrivatebinSettings
|
|
{
|
|
private String serverUrl;
|
|
private String expirationDate;
|
|
private String burnAfterReading;
|
|
private String openDiscussion;
|
|
|
|
/**
|
|
* Instantiates a new Privatebin settings.
|
|
*/
|
|
public PrivatebinSettings()
|
|
{
|
|
this.serverUrl = null;
|
|
this.expirationDate = null;
|
|
this.burnAfterReading = null;
|
|
this.openDiscussion = null;
|
|
}
|
|
|
|
public String getBurnAfterReading()
|
|
{
|
|
return this.burnAfterReading;
|
|
}
|
|
|
|
public String getExpirationDate()
|
|
{
|
|
return this.expirationDate;
|
|
}
|
|
|
|
public String getOpenDiscussion()
|
|
{
|
|
return this.openDiscussion;
|
|
}
|
|
|
|
public String getServerUrl()
|
|
{
|
|
return this.serverUrl;
|
|
}
|
|
|
|
/**
|
|
* Checks if is valid.
|
|
*
|
|
* @return true, if is valid
|
|
*/
|
|
public boolean isValid()
|
|
{
|
|
boolean result;
|
|
|
|
if ((StringUtils.isBlank(this.serverUrl)) || (StringUtils.containsOnly(this.serverUrl, 'X')))
|
|
{
|
|
result = false;
|
|
}
|
|
else
|
|
{
|
|
result = true;
|
|
}
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
public void setBurnAfterReading(final String burnAfterReading)
|
|
{
|
|
this.burnAfterReading = burnAfterReading;
|
|
}
|
|
|
|
public void setExpirationDate(final String expirationDate)
|
|
{
|
|
this.expirationDate = expirationDate;
|
|
}
|
|
|
|
public void setOpenDiscussion(final String openDiscussion)
|
|
{
|
|
this.openDiscussion = openDiscussion;
|
|
}
|
|
|
|
public void setServerUrl(final String serverUrl)
|
|
{
|
|
this.serverUrl = serverUrl;
|
|
}
|
|
}
|