Added semantic version annotations.
Added and updated license.
This commit is contained in:
parent
b71c488977
commit
9cf5ee8fbc
32 changed files with 1227 additions and 671 deletions
128
src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java
Normal file
128
src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java
Normal file
|
@ -0,0 +1,128 @@
|
|||
/*
|
||||
* This file is automatically generated by the Semantic Version Annotation Processor.
|
||||
* Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||
*/
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* This class provides semantic version information.
|
||||
*
|
||||
* @author Semantic Version Annotation Processor
|
||||
*/
|
||||
public final class ReleaseInfo {
|
||||
private final static String buildmeta = "002";
|
||||
private final static Date date = new Date(1453769004642L);
|
||||
private final static int major = 0;
|
||||
private final static int minor = 6;
|
||||
private final static int patch = 1;
|
||||
private final static String prerelease = "beta";
|
||||
private final static String project = "mobibot";
|
||||
|
||||
/**
|
||||
* Returns the build date.
|
||||
*
|
||||
* @return The build date.
|
||||
*/
|
||||
public static Date getBuildDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the full version string.
|
||||
* <p>
|
||||
* Formatted as:
|
||||
* <blockquote>
|
||||
* <code>MAJOR.MINOR.PATCH[-PRERELEASE][+BUILDMETADATA]</code>
|
||||
* </blockquote>
|
||||
* <p>
|
||||
* For example:
|
||||
* <ul>
|
||||
* <li><code>1.0.0</code></li>
|
||||
* <li><code>1.0.0-beta</code></li>
|
||||
* <li><code>1.0.0+20160124144700</code></li>
|
||||
* <li><code>1.0.0-alpha+001</code></li>
|
||||
* </ul>
|
||||
*
|
||||
* @return The version string.
|
||||
*/
|
||||
public static String getVersion() {
|
||||
return Integer.toString(getMajor()) + '.'
|
||||
+ Integer.toString(getMinor()) + '.'
|
||||
+ Integer.toString(getPatch())
|
||||
+ getPreRelease() + getBuildMetadata();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the major version.
|
||||
*
|
||||
* @return The major version.
|
||||
*/
|
||||
public static int getMajor() {
|
||||
return major;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the minor version.
|
||||
*
|
||||
* @return The minor version.
|
||||
*/
|
||||
public static int getMinor() {
|
||||
return minor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the patch version.
|
||||
*
|
||||
* @return The patch version.
|
||||
*/
|
||||
public static int getPatch() {
|
||||
return patch;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the pre-release version.
|
||||
*
|
||||
* @return The pre-release version, if any.
|
||||
*/
|
||||
public static String getPreRelease() {
|
||||
if (prerelease.length() > 0) {
|
||||
return '-' + prerelease;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the project name.
|
||||
*
|
||||
* @return The project name, if any.
|
||||
*/
|
||||
public static String getProject() {
|
||||
return project;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the build metadata.
|
||||
*
|
||||
* @return The build metadata, if any.
|
||||
*/
|
||||
public static String getBuildMetadata() {
|
||||
if (buildmeta.length() > 0) {
|
||||
return '+' + buildmeta;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables the default constructor.
|
||||
*
|
||||
* @throws UnsupportedOperationException if the constructor is called.
|
||||
*/
|
||||
private ReleaseInfo()
|
||||
throws UnsupportedOperationException {
|
||||
throw new UnsupportedOperationException("Illegal constructor call.");
|
||||
}
|
||||
}
|
|
@ -1,35 +1,33 @@
|
|||
/*
|
||||
* Commands.java
|
||||
*
|
||||
* Copyright (c) 2004-2015, Erik C. Thauvin (erik@thauvin.net)
|
||||
* Copyright (c) 2004-2016, Erik C. Thauvin (erik@thauvin.net)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* Neither the name of this project nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
|
@ -40,7 +38,7 @@ package net.thauvin.erik.mobibot;
|
|||
* @created 2014-04-26
|
||||
* @since 1.0
|
||||
*/
|
||||
class Commands
|
||||
final class Commands
|
||||
{
|
||||
/**
|
||||
* The add (back)log command.
|
||||
|
|
|
@ -1,35 +1,33 @@
|
|||
/*
|
||||
* CurrencyConverter.java
|
||||
*
|
||||
* Copyright (c) 2004-2015, Erik C. Thauvin (erik@thauvin.net)
|
||||
* Copyright (c) 2004-2016, Erik C. Thauvin (erik@thauvin.net)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* Neither the name of this project nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
|
|
|
@ -1,35 +1,33 @@
|
|||
/*
|
||||
* DeliciousPoster.java
|
||||
*
|
||||
* Copyright (c) 2004-2015, Erik C. Thauvin (erik@thauvin.net)
|
||||
* Copyright (c) 2004-2016, Erik C. Thauvin (erik@thauvin.net)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* Neither the name of this project nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
|
@ -55,7 +53,7 @@ class DeliciousPoster
|
|||
* @param password The del.icio.us password.
|
||||
* @param ircServer The IRC server.
|
||||
*/
|
||||
public DeliciousPoster(String username, String password, String ircServer)
|
||||
public DeliciousPoster(final String username, final String password, final String ircServer)
|
||||
{
|
||||
delicious = new Delicious(username, password);
|
||||
this.ircServer = ircServer;
|
||||
|
@ -90,7 +88,7 @@ class DeliciousPoster
|
|||
*
|
||||
* @return The extended attribution line.
|
||||
*/
|
||||
private String postedBy(EntryLink entry)
|
||||
private String postedBy(final EntryLink entry)
|
||||
{
|
||||
return "Posted by " + entry.getNick() + " on " + entry.getChannel() + " (" + ircServer + ')';
|
||||
}
|
||||
|
@ -100,7 +98,7 @@ class DeliciousPoster
|
|||
*
|
||||
* @param entry The entry to delete.
|
||||
*/
|
||||
public final void deletePost(EntryLink entry)
|
||||
public final void deletePost(final EntryLink entry)
|
||||
{
|
||||
final String link = entry.getLink();
|
||||
|
||||
|
|
|
@ -1,35 +1,33 @@
|
|||
/*
|
||||
* Dice.java
|
||||
*
|
||||
* Copyright (c) 2004-2015, Erik C. Thauvin (erik@thauvin.net)
|
||||
* Copyright (c) 2004-2016, Erik C. Thauvin (erik@thauvin.net)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* Neither the name of this project nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
|
@ -42,7 +40,7 @@ import java.util.Random;
|
|||
* @created 2014-04-28
|
||||
* @since 1.0
|
||||
*/
|
||||
class Dice
|
||||
final class Dice
|
||||
{
|
||||
/**
|
||||
* Disables the default constructor.
|
||||
|
@ -61,7 +59,7 @@ class Dice
|
|||
* @param bot The bot's instance.
|
||||
* @param sender The sender's nickname.
|
||||
*/
|
||||
public static void roll(Mobibot bot, String sender)
|
||||
public static void roll(final Mobibot bot, final String sender)
|
||||
{
|
||||
final Random r = new Random();
|
||||
|
||||
|
|
|
@ -1,35 +1,33 @@
|
|||
/*
|
||||
* EntriesMgr.java
|
||||
*
|
||||
* Copyright (c) 2004-2015, Erik C. Thauvin (erik@thauvin.net)
|
||||
* Copyright (c) 2004-2016, Erik C. Thauvin (erik@thauvin.net)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* Neither the name of this project nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
|
@ -50,7 +48,7 @@ import java.util.List;
|
|||
* @created 2014-04-28
|
||||
* @since 1.0
|
||||
*/
|
||||
class EntriesMgr
|
||||
final class EntriesMgr
|
||||
{
|
||||
/**
|
||||
* The name of the file containing the current entries.
|
||||
|
@ -92,7 +90,7 @@ class EntriesMgr
|
|||
* @throws FileNotFoundException If the file was not found.
|
||||
* @throws FeedException If an error occurred while reading the feed.
|
||||
*/
|
||||
public static void loadBacklogs(String file, List<String> history)
|
||||
public static void loadBacklogs(final String file, final List<String> history)
|
||||
throws FileNotFoundException, FeedException
|
||||
{
|
||||
history.clear();
|
||||
|
@ -145,7 +143,7 @@ class EntriesMgr
|
|||
* @throws com.sun.syndication.io.FeedException If an error occurred while reading the feed.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static String loadEntries(String file, String channel, List<EntryLink> entries)
|
||||
public static String loadEntries(final String file, final String channel, final List<EntryLink> entries)
|
||||
throws FileNotFoundException, FeedException
|
||||
{
|
||||
entries.clear();
|
||||
|
@ -224,7 +222,7 @@ class EntriesMgr
|
|||
* @param history The history array.
|
||||
* @param isDayBackup Set the true if the daily backup file should also be created.
|
||||
*/
|
||||
public static void saveEntries(Mobibot bot, List<EntryLink> entries, List<String> history, boolean isDayBackup)
|
||||
public static void saveEntries(final Mobibot bot, final List<EntryLink> entries, final List<String> history, final boolean isDayBackup)
|
||||
{
|
||||
if (bot.getLogger().isDebugEnabled())
|
||||
{
|
||||
|
|
|
@ -1,35 +1,33 @@
|
|||
/*
|
||||
* EntryComment.java
|
||||
*
|
||||
* Copyright (c) 2004-2015, Erik C. Thauvin (erik@thauvin.net)
|
||||
* Copyright (c) 2004-2016, Erik C. Thauvin (erik@thauvin.net)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* Neither the name of this project nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
|
@ -66,7 +64,7 @@ public class EntryComment implements Serializable
|
|||
* @param comment The new comment.
|
||||
* @param nick The nickname of the comment's author.
|
||||
*/
|
||||
public EntryComment(String comment, String nick)
|
||||
public EntryComment(final String comment, final String nick)
|
||||
{
|
||||
this.comment = comment;
|
||||
this.nick = nick;
|
||||
|
@ -97,7 +95,7 @@ public class EntryComment implements Serializable
|
|||
* @param comment The actual comment.
|
||||
*/
|
||||
@SuppressWarnings("UnusedDeclaration")
|
||||
public final void setComment(String comment)
|
||||
public final void setComment(final String comment)
|
||||
{
|
||||
this.comment = comment;
|
||||
}
|
||||
|
@ -128,7 +126,7 @@ public class EntryComment implements Serializable
|
|||
*
|
||||
* @param nick The new nickname.
|
||||
*/
|
||||
public final void setNick(String nick)
|
||||
public final void setNick(final String nick)
|
||||
{
|
||||
this.nick = nick;
|
||||
}
|
||||
|
|
|
@ -1,35 +1,33 @@
|
|||
/*
|
||||
* EntryLink.java
|
||||
*
|
||||
* Copyright (c) 2004-2015, Erik C. Thauvin (erik@thauvin.net)
|
||||
* Copyright (c) 2004-2016, Erik C. Thauvin (erik@thauvin.net)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* Neither the name of this project nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
|
@ -89,7 +87,7 @@ public class EntryLink implements Serializable
|
|||
* @param channel The channel.
|
||||
* @param tags The entry's tags/categories.
|
||||
*/
|
||||
public EntryLink(String link, String title, String nick, String login, String channel, String tags)
|
||||
public EntryLink(final String link, final String title, final String nick, final String login, final String channel, final String tags)
|
||||
{
|
||||
this.link = link;
|
||||
this.title = title;
|
||||
|
@ -105,7 +103,7 @@ public class EntryLink implements Serializable
|
|||
*
|
||||
* @param tags The space-delimited tags.
|
||||
*/
|
||||
public final void setTags(String tags)
|
||||
public final void setTags(final String tags)
|
||||
{
|
||||
if (tags != null)
|
||||
{
|
||||
|
@ -165,7 +163,7 @@ public class EntryLink implements Serializable
|
|||
* @param date The entry date.
|
||||
* @param tags The entry's tags/categories.
|
||||
*/
|
||||
public EntryLink(String link, String title, String nick, String channel, Date date, List<SyndCategoryImpl> tags)
|
||||
public EntryLink(final String link, final String title, final String nick, final String channel, final Date date, final List<SyndCategoryImpl> tags)
|
||||
{
|
||||
this.link = link;
|
||||
this.title = title;
|
||||
|
@ -184,7 +182,7 @@ public class EntryLink implements Serializable
|
|||
*
|
||||
* @return The total number of comments for this entry.
|
||||
*/
|
||||
public final int addComment(String comment, String nick)
|
||||
public final int addComment(final String comment, final String nick)
|
||||
{
|
||||
comments.add(new EntryComment(comment, nick));
|
||||
|
||||
|
@ -196,7 +194,7 @@ public class EntryLink implements Serializable
|
|||
*
|
||||
* @param index The index of the comment to delete.
|
||||
*/
|
||||
public final void deleteComment(int index)
|
||||
public final void deleteComment(final int index)
|
||||
{
|
||||
if (index < comments.size())
|
||||
{
|
||||
|
@ -220,7 +218,7 @@ public class EntryLink implements Serializable
|
|||
* @param channel The channel.
|
||||
*/
|
||||
@SuppressWarnings("UnusedDeclaration")
|
||||
public final void setChannel(String channel)
|
||||
public final void setChannel(final String channel)
|
||||
{
|
||||
this.channel = channel;
|
||||
}
|
||||
|
@ -232,7 +230,7 @@ public class EntryLink implements Serializable
|
|||
*
|
||||
* @return The specific comment.
|
||||
*/
|
||||
public final EntryComment getComment(int index)
|
||||
public final EntryComment getComment(final int index)
|
||||
{
|
||||
return (comments.get(index));
|
||||
}
|
||||
|
@ -300,7 +298,7 @@ public class EntryLink implements Serializable
|
|||
*
|
||||
* @param link The new link.
|
||||
*/
|
||||
public final void setLink(String link)
|
||||
public final void setLink(final String link)
|
||||
{
|
||||
this.link = link;
|
||||
}
|
||||
|
@ -321,7 +319,7 @@ public class EntryLink implements Serializable
|
|||
* @param login The new login.
|
||||
*/
|
||||
@SuppressWarnings("UnusedDeclaration")
|
||||
public final void setLogin(String login)
|
||||
public final void setLogin(final String login)
|
||||
{
|
||||
this.login = login;
|
||||
}
|
||||
|
@ -341,7 +339,7 @@ public class EntryLink implements Serializable
|
|||
*
|
||||
* @param nick The new nickname.
|
||||
*/
|
||||
public final void setNick(String nick)
|
||||
public final void setNick(final String nick)
|
||||
{
|
||||
this.nick = nick;
|
||||
}
|
||||
|
@ -361,7 +359,7 @@ public class EntryLink implements Serializable
|
|||
*
|
||||
* @param tags The tags.
|
||||
*/
|
||||
private void setTags(List<SyndCategoryImpl> tags)
|
||||
private void setTags(final List<SyndCategoryImpl> tags)
|
||||
{
|
||||
this.tags.addAll(tags);
|
||||
}
|
||||
|
@ -381,7 +379,7 @@ public class EntryLink implements Serializable
|
|||
*
|
||||
* @param title The new title.
|
||||
*/
|
||||
public final void setTitle(String title)
|
||||
public final void setTitle(final String title)
|
||||
{
|
||||
this.title = title;
|
||||
}
|
||||
|
@ -413,7 +411,7 @@ public class EntryLink implements Serializable
|
|||
* @param comment The actual comment.
|
||||
* @param nick The nickname of the author of the comment.
|
||||
*/
|
||||
public final void setComment(int index, String comment, String nick)
|
||||
public final void setComment(final int index, final String comment, final String nick)
|
||||
{
|
||||
if (index < comments.size())
|
||||
{
|
||||
|
|
|
@ -1,35 +1,33 @@
|
|||
/*
|
||||
* FeedReader.java
|
||||
*
|
||||
* Copyright (c) 2004-2015, Erik C. Thauvin (erik@thauvin.net)
|
||||
* Copyright (c) 2004-2016, Erik C. Thauvin (erik@thauvin.net)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* Neither the name of this project nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
|
@ -84,7 +82,7 @@ class FeedReader implements Runnable
|
|||
* @param sender The nick of the person who sent the message.
|
||||
* @param url The URL to fetch.
|
||||
*/
|
||||
public FeedReader(Mobibot bot, String sender, String url)
|
||||
public FeedReader(final Mobibot bot, final String sender, final String url)
|
||||
{
|
||||
this.bot = bot;
|
||||
this.sender = sender;
|
||||
|
|
|
@ -1,35 +1,33 @@
|
|||
/*
|
||||
* GoogleSearch.java
|
||||
*
|
||||
* Copyright (c) 2004-2015, Erik C. Thauvin (erik@thauvin.net)
|
||||
* Copyright (c) 2004-2016, Erik C. Thauvin (erik@thauvin.net)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* Neither the name of this project nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
|
@ -78,7 +76,7 @@ class GoogleSearch implements Runnable
|
|||
* @param sender The nick of the person who sent the message.
|
||||
* @param query The Google query
|
||||
*/
|
||||
public GoogleSearch(Mobibot bot, String sender, String query)
|
||||
public GoogleSearch(final Mobibot bot, final String sender, final String query)
|
||||
{
|
||||
this.bot = bot;
|
||||
this.sender = sender;
|
||||
|
|
|
@ -1,35 +1,33 @@
|
|||
/*
|
||||
* Joke.java
|
||||
*
|
||||
* Copyright (c) 2004-2015, Erik C. Thauvin (erik@thauvin.net)
|
||||
* Copyright (c) 2004-2016, Erik C. Thauvin (erik@thauvin.net)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* Neither the name of this project nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
|
@ -72,7 +70,7 @@ class Joke implements Runnable
|
|||
* @param bot The bot's instance.
|
||||
* @param sender The nick of the person who sent the message.
|
||||
*/
|
||||
public Joke(Mobibot bot, String sender)
|
||||
public Joke(final Mobibot bot, final String sender)
|
||||
{
|
||||
this.bot = bot;
|
||||
this.sender = sender;
|
||||
|
|
|
@ -1,35 +1,33 @@
|
|||
/*
|
||||
* Lookup.java
|
||||
*
|
||||
* Copyright (c) 2004-2015, Erik C. Thauvin (erik@thauvin.net)
|
||||
* Copyright (c) 2004-2016, Erik C. Thauvin (erik@thauvin.net)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* Neither the name of this project nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
|
@ -46,7 +44,7 @@ import java.net.UnknownHostException;
|
|||
* @created 2014-04-26
|
||||
* @since 1.0
|
||||
*/
|
||||
class Lookup
|
||||
final class Lookup
|
||||
{
|
||||
|
||||
/**
|
||||
|
@ -74,7 +72,7 @@ class Lookup
|
|||
*
|
||||
* @throws java.net.UnknownHostException If the host is unknown.
|
||||
*/
|
||||
public static String lookup(String query)
|
||||
public static String lookup(final String query)
|
||||
throws UnknownHostException
|
||||
{
|
||||
final StringBuilder buffer = new StringBuilder("");
|
||||
|
@ -118,7 +116,7 @@ class Lookup
|
|||
*
|
||||
* @throws java.io.IOException If a connection error occurs.
|
||||
*/
|
||||
public static String[] whois(String query)
|
||||
public static String[] whois(final String query)
|
||||
throws IOException
|
||||
{
|
||||
return whois(query, WHOIS_HOST);
|
||||
|
@ -135,7 +133,7 @@ class Lookup
|
|||
* @throws java.io.IOException If a connection error occurs.
|
||||
*/
|
||||
@SuppressWarnings("WeakerAccess, SameParameterValue")
|
||||
public static String[] whois(String query, String host)
|
||||
public static String[] whois(final String query, final String host)
|
||||
throws IOException
|
||||
{
|
||||
final WhoisClient whois = new WhoisClient();
|
||||
|
|
|
@ -1,35 +1,33 @@
|
|||
/*
|
||||
* Mobibot.java
|
||||
*
|
||||
* Copyright (c) 2004-2015, Erik C. Thauvin (erik@thauvin.net)
|
||||
* Copyright (c) 2004-2016, Erik C. Thauvin (erik@thauvin.net)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* Neither the name of this project nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
|
@ -38,6 +36,7 @@ import com.sun.syndication.fetcher.impl.HashMapFeedInfoCache;
|
|||
import com.sun.syndication.io.FeedException;
|
||||
import net.objecthunter.exp4j.Expression;
|
||||
import net.objecthunter.exp4j.ExpressionBuilder;
|
||||
import net.thauvin.erik.semver.Version;
|
||||
import org.apache.commons.cli.*;
|
||||
import org.apache.commons.logging.impl.Log4JLogger;
|
||||
import org.apache.log4j.Level;
|
||||
|
@ -60,6 +59,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
|||
* @created Jan 31, 2004
|
||||
* @since 1.0
|
||||
*/
|
||||
@Version(properties = "version.properties", className = "ReleaseInfo")
|
||||
public class Mobibot extends PircBot
|
||||
{
|
||||
/**
|
||||
|
@ -92,8 +92,8 @@ public class Mobibot extends PircBot
|
|||
* The info strings.
|
||||
*/
|
||||
private static final String[] INFO_STRS = {
|
||||
ReleaseInfo.getProject() + " v" + ReleaseInfo.getVersion() + '.' + ReleaseInfo.getBuildNumber()
|
||||
+ " by Erik C. Thauvin (erik@thauvin.net)", "http://www.mobitopia.org/mobibot/"
|
||||
ReleaseInfo.getProject() + " v" + ReleaseInfo.getVersion() + " by Erik C. Thauvin (erik@thauvin.net)",
|
||||
"http://www.mobitopia.org/mobibot/"
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -145,8 +145,7 @@ public class Mobibot extends PircBot
|
|||
* The version strings.
|
||||
*/
|
||||
private static final String[] VERSION_STRS = {
|
||||
"Version: " + ReleaseInfo.getVersion() + '.' + ReleaseInfo.getBuildNumber() + " (" + Utils.ISO_SDF
|
||||
.format(ReleaseInfo.getBuildDate()) + ')',
|
||||
"Version: " + ReleaseInfo.getVersion() + " (" + Utils.ISO_SDF.format(ReleaseInfo.getBuildDate()) + ')',
|
||||
"Platform: " + System.getProperty("os.name") + " (" + System.getProperty("os.version") + ", " + System
|
||||
.getProperty("os.arch") + ", " + System.getProperty("user.country") + ')',
|
||||
"Runtime: " + System.getProperty("java.runtime.name") + " (build " + System
|
||||
|
@ -320,7 +319,8 @@ public class Mobibot extends PircBot
|
|||
* @param logsDir The logs directory.
|
||||
*/
|
||||
@SuppressWarnings("WeakerAccess")
|
||||
public Mobibot(String server, int port, String nickname, String channel, String logsDir)
|
||||
public Mobibot(final String server, final int port, final String nickname, final String channel,
|
||||
final String logsDir)
|
||||
{
|
||||
System.getProperties().setProperty("sun.net.client.defaultConnectTimeout", String.valueOf(CONNECT_TIMEOUT));
|
||||
System.getProperties().setProperty("sun.net.client.defaultReadTimeout", String.valueOf(CONNECT_TIMEOUT));
|
||||
|
@ -385,7 +385,7 @@ public class Mobibot extends PircBot
|
|||
*
|
||||
* @param args The command line arguments.
|
||||
*/
|
||||
public static void main(String[] args)
|
||||
public static void main(final String[] args)
|
||||
{
|
||||
// Setup the command line options
|
||||
final Options options = new Options();
|
||||
|
@ -639,7 +639,7 @@ public class Mobibot extends PircBot
|
|||
*
|
||||
* @param pwd The password.
|
||||
*/
|
||||
private void setIdent(String pwd)
|
||||
private void setIdent(final String pwd)
|
||||
{
|
||||
ident = pwd;
|
||||
}
|
||||
|
@ -649,7 +649,7 @@ public class Mobibot extends PircBot
|
|||
*
|
||||
* @param nick The nickname.
|
||||
*/
|
||||
private void setIdentNick(String nick)
|
||||
private void setIdentNick(final String nick)
|
||||
{
|
||||
identNick = nick;
|
||||
}
|
||||
|
@ -659,7 +659,7 @@ public class Mobibot extends PircBot
|
|||
*
|
||||
* @param msg The message.
|
||||
*/
|
||||
private void setIdentMsg(String msg)
|
||||
private void setIdentMsg(final String msg)
|
||||
{
|
||||
identMsg = msg;
|
||||
}
|
||||
|
@ -669,7 +669,7 @@ public class Mobibot extends PircBot
|
|||
*
|
||||
* @param feedURL The feed URL.
|
||||
*/
|
||||
private void setFeedURL(String feedURL)
|
||||
private void setFeedURL(final String feedURL)
|
||||
{
|
||||
this.feedURL = feedURL;
|
||||
}
|
||||
|
@ -680,7 +680,7 @@ public class Mobibot extends PircBot
|
|||
* @param username The del.icio.us user name.
|
||||
* @param password The del.icio.us password.
|
||||
*/
|
||||
private void setDeliciousAuth(String username, String password)
|
||||
private void setDeliciousAuth(final String username, final String password)
|
||||
{
|
||||
delicious = new DeliciousPoster(username, password, ircServer);
|
||||
}
|
||||
|
@ -693,7 +693,8 @@ public class Mobibot extends PircBot
|
|||
* @param token The Twitter token.
|
||||
* @param tokenSecret The Twitter token secret.
|
||||
*/
|
||||
private void setTwitterAuth(String consumerKey, String consumerSecret, String token, String tokenSecret)
|
||||
private void setTwitterAuth(final String consumerKey, final String consumerSecret, final String token,
|
||||
final String tokenSecret)
|
||||
{
|
||||
twitterConsumerKey = consumerKey;
|
||||
twitterConsumerSecret = consumerSecret;
|
||||
|
@ -706,7 +707,7 @@ public class Mobibot extends PircBot
|
|||
*
|
||||
* @param tags The tags.
|
||||
*/
|
||||
private void setTags(String tags)
|
||||
private void setTags(final String tags)
|
||||
{
|
||||
defaultTags = tags;
|
||||
}
|
||||
|
@ -716,7 +717,7 @@ public class Mobibot extends PircBot
|
|||
*
|
||||
* @param nicks The nicks to ignore
|
||||
*/
|
||||
private void setIgnoredNicks(String nicks)
|
||||
private void setIgnoredNicks(final String nicks)
|
||||
{
|
||||
if (Utils.isValidString(nicks))
|
||||
{
|
||||
|
@ -735,7 +736,7 @@ public class Mobibot extends PircBot
|
|||
* @param tellMaxDays The max number of days to hold messages for.
|
||||
* @param tellMaxSize The maximum number of messages to hold
|
||||
*/
|
||||
private void setTell(int tellMaxDays, int tellMaxSize)
|
||||
private void setTell(final int tellMaxDays, final int tellMaxSize)
|
||||
{
|
||||
this.tellMaxDays = tellMaxDays;
|
||||
this.tellMaxSize = tellMaxSize;
|
||||
|
@ -746,7 +747,7 @@ public class Mobibot extends PircBot
|
|||
*
|
||||
* @param isDayBackup Set the true if the daily backup file should also be created.
|
||||
*/
|
||||
private void saveEntries(boolean isDayBackup)
|
||||
private void saveEntries(final boolean isDayBackup)
|
||||
{
|
||||
EntriesMgr.saveEntries(this, entries, history, isDayBackup);
|
||||
}
|
||||
|
@ -756,7 +757,7 @@ public class Mobibot extends PircBot
|
|||
*
|
||||
* @param secs The number of seconds to sleep for.
|
||||
*/
|
||||
private static void sleep(int secs)
|
||||
private static void sleep(final int secs)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -816,7 +817,7 @@ public class Mobibot extends PircBot
|
|||
*
|
||||
* @param action The action.
|
||||
*/
|
||||
final void action(String action)
|
||||
final void action(final String action)
|
||||
{
|
||||
action(channel, action);
|
||||
}
|
||||
|
@ -827,7 +828,7 @@ public class Mobibot extends PircBot
|
|||
* @param channel The channel.
|
||||
* @param action The action.
|
||||
*/
|
||||
private void action(String channel, String action)
|
||||
private void action(final String channel, final String action)
|
||||
{
|
||||
if (Utils.isValidString(channel) && Utils.isValidString(action))
|
||||
{
|
||||
|
@ -842,7 +843,7 @@ public class Mobibot extends PircBot
|
|||
* @param args The command arguments.
|
||||
* @param message The actual message.
|
||||
*/
|
||||
private void calcResponse(String sender, String args, String message)
|
||||
private void calcResponse(final String sender, final String args, final String message)
|
||||
{
|
||||
if (Utils.isValidString(args))
|
||||
{
|
||||
|
@ -874,7 +875,7 @@ public class Mobibot extends PircBot
|
|||
*
|
||||
* @param sender The nick of the person who sent the private message.
|
||||
*/
|
||||
private void feedResponse(String sender)
|
||||
private void feedResponse(final String sender)
|
||||
{
|
||||
if (Utils.isValidString(feedURL))
|
||||
{
|
||||
|
@ -893,7 +894,7 @@ public class Mobibot extends PircBot
|
|||
*
|
||||
* @return The index or -1 if none.
|
||||
*/
|
||||
private int findDupEntry(String link)
|
||||
private int findDupEntry(final String link)
|
||||
{
|
||||
EntryLink entry;
|
||||
|
||||
|
@ -928,7 +929,7 @@ public class Mobibot extends PircBot
|
|||
*
|
||||
* @param backLogsUrl The backlogs URL.
|
||||
*/
|
||||
private void setBacklogsUrl(String backLogsUrl)
|
||||
private void setBacklogsUrl(final String backLogsUrl)
|
||||
{
|
||||
this.backLogsUrl = backLogsUrl;
|
||||
}
|
||||
|
@ -1027,7 +1028,7 @@ public class Mobibot extends PircBot
|
|||
*
|
||||
* @param weblogUrl The weblog URL.
|
||||
*/
|
||||
private void setWeblogUrl(String weblogUrl)
|
||||
private void setWeblogUrl(final String weblogUrl)
|
||||
{
|
||||
this.weblogUrl = weblogUrl;
|
||||
}
|
||||
|
@ -1038,7 +1039,7 @@ public class Mobibot extends PircBot
|
|||
* @param sender The nick of the person who sent the private message.
|
||||
* @param query The Google query to execute.
|
||||
*/
|
||||
private void googleResponse(String sender, String query)
|
||||
private void googleResponse(final String sender, final String query)
|
||||
{
|
||||
if (query.length() > 0)
|
||||
{
|
||||
|
@ -1057,7 +1058,7 @@ public class Mobibot extends PircBot
|
|||
*
|
||||
* @return The indented help string.
|
||||
*/
|
||||
private String helpIndent(String help)
|
||||
private String helpIndent(final String help)
|
||||
{
|
||||
return helpIndent(help, true);
|
||||
}
|
||||
|
@ -1070,7 +1071,7 @@ public class Mobibot extends PircBot
|
|||
*
|
||||
* @return The indented help string.
|
||||
*/
|
||||
private String helpIndent(String help, boolean isBold)
|
||||
private String helpIndent(final String help, final boolean isBold)
|
||||
{
|
||||
return " " + (isBold ? Utils.bold(help) : help);
|
||||
}
|
||||
|
@ -1081,7 +1082,7 @@ public class Mobibot extends PircBot
|
|||
* @param sender The nick of the person who sent the private message.
|
||||
* @param topic The help topic, if any.
|
||||
*/
|
||||
public final void helpResponse(String sender, String topic)
|
||||
public final void helpResponse(final String sender, final String topic)
|
||||
{
|
||||
final String lcTopic = topic.toLowerCase();
|
||||
|
||||
|
@ -1336,7 +1337,7 @@ public class Mobibot extends PircBot
|
|||
* @param sender The sender.
|
||||
* @param args The command arguments.
|
||||
*/
|
||||
private void ignoreResponse(String sender, String args)
|
||||
private void ignoreResponse(final String sender, final String args)
|
||||
{
|
||||
if (!isOp(sender))
|
||||
{
|
||||
|
@ -1404,7 +1405,7 @@ public class Mobibot extends PircBot
|
|||
* @param sender The nick of the person who sent the message.
|
||||
* @param isPrivate Set to true is the response should be send as a private message.
|
||||
*/
|
||||
private void infoResponse(String sender, boolean isPrivate)
|
||||
private void infoResponse(final String sender, final boolean isPrivate)
|
||||
{
|
||||
for (final String info : INFO_STRS)
|
||||
{
|
||||
|
@ -1434,7 +1435,7 @@ public class Mobibot extends PircBot
|
|||
*
|
||||
* @return <code>true</code> if the nick should be ignored, <code>false</code> otherwise.
|
||||
*/
|
||||
private boolean isIgnoredNick(String nick)
|
||||
private boolean isIgnoredNick(final String nick)
|
||||
{
|
||||
return Utils.isValidString(nick) && ignoredNicks.contains(nick.toLowerCase());
|
||||
|
||||
|
@ -1447,7 +1448,7 @@ public class Mobibot extends PircBot
|
|||
*
|
||||
* @return true, if the sender is an Op.
|
||||
*/
|
||||
private boolean isOp(String sender)
|
||||
private boolean isOp(final String sender)
|
||||
{
|
||||
final User[] users = getUsers(channel);
|
||||
|
||||
|
@ -1479,7 +1480,7 @@ public class Mobibot extends PircBot
|
|||
* @param sender The nick of the person who sent the message
|
||||
* @param query The hostname or IP address.
|
||||
*/
|
||||
private void lookupResponse(String sender, String query)
|
||||
private void lookupResponse(final String sender, final String query)
|
||||
{
|
||||
if (query.matches("(\\S.)+(\\S)+"))
|
||||
{
|
||||
|
@ -1598,7 +1599,8 @@ public class Mobibot extends PircBot
|
|||
}
|
||||
|
||||
@Override
|
||||
protected final void onMessage(String channel, String sender, String login, String hostname, String message)
|
||||
protected final void onMessage(final String channel, final String sender, final String login, final String hostname,
|
||||
final String message)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
|
@ -2093,7 +2095,8 @@ public class Mobibot extends PircBot
|
|||
}
|
||||
|
||||
@Override
|
||||
protected final void onPrivateMessage(String sender, String login, String hostname, String message)
|
||||
protected final void onPrivateMessage(final String sender, final String login, final String hostname,
|
||||
final String message)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
|
@ -2270,7 +2273,8 @@ public class Mobibot extends PircBot
|
|||
}
|
||||
|
||||
@Override
|
||||
protected final void onAction(String sender, String login, String hostname, String target, String action)
|
||||
protected final void onAction(final String sender, final String login, final String hostname, final String target,
|
||||
final String action)
|
||||
{
|
||||
if (target.equals(channel))
|
||||
{
|
||||
|
@ -2285,7 +2289,7 @@ public class Mobibot extends PircBot
|
|||
* @param message The actual message sent.
|
||||
* @param isAction Set to true if the message is an action.
|
||||
*/
|
||||
private void recap(String sender, String message, boolean isAction)
|
||||
private void recap(final String sender, final String message, final boolean isAction)
|
||||
{
|
||||
recap.add(Utils.UTC_SDF.format(Calendar.getInstance().getTime()) + " -> " + sender + (isAction ? " " : ": ")
|
||||
+ message);
|
||||
|
@ -2297,13 +2301,13 @@ public class Mobibot extends PircBot
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void onJoin(String channel, String sender, String login, String hostname)
|
||||
protected void onJoin(final String channel, final String sender, final String login, final String hostname)
|
||||
{
|
||||
tellSendMessages(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNickChange(String oldNick, String login, String hostname, String newNick)
|
||||
protected void onNickChange(final String oldNick, final String login, final String hostname, final String newNick)
|
||||
{
|
||||
tellSendMessages(newNick);
|
||||
}
|
||||
|
@ -2313,7 +2317,7 @@ public class Mobibot extends PircBot
|
|||
*
|
||||
* @param nickname The user's nickname.
|
||||
*/
|
||||
private void tellSendMessages(String nickname)
|
||||
private void tellSendMessages(final String nickname)
|
||||
{
|
||||
tellSendMessages(nickname, false);
|
||||
}
|
||||
|
@ -2324,7 +2328,7 @@ public class Mobibot extends PircBot
|
|||
* @param nickname The user's nickname.
|
||||
* @param isMessage The message flag.
|
||||
*/
|
||||
private void tellSendMessages(String nickname, boolean isMessage)
|
||||
private void tellSendMessages(final String nickname, final boolean isMessage)
|
||||
{
|
||||
if (!nickname.equals(getNick()) && isTellEnabled())
|
||||
{
|
||||
|
@ -2396,7 +2400,7 @@ public class Mobibot extends PircBot
|
|||
* @param message The actual message.
|
||||
* @param isPrivate Set to true if the response should be a private message, otherwise a notice is sent.
|
||||
*/
|
||||
public final void send(String sender, String message, boolean isPrivate)
|
||||
public final void send(final String sender, final String message, final boolean isPrivate)
|
||||
{
|
||||
if (Utils.isValidString(message) && Utils.isValidString(sender))
|
||||
{
|
||||
|
@ -2427,7 +2431,7 @@ public class Mobibot extends PircBot
|
|||
* @param sender The nick of the person who sent the private message.
|
||||
* @param isPrivate Set to true is the response should be send as a private message.
|
||||
*/
|
||||
private void recapResponse(String sender, boolean isPrivate)
|
||||
private void recapResponse(final String sender, final boolean isPrivate)
|
||||
{
|
||||
for (final String recap : this.recap)
|
||||
{
|
||||
|
@ -2441,7 +2445,7 @@ public class Mobibot extends PircBot
|
|||
* @param sender The nick of the person who sent the message.
|
||||
* @param message The actual message.
|
||||
*/
|
||||
public final void send(String sender, String message)
|
||||
public final void send(final String sender, final String message)
|
||||
{
|
||||
send(sender, message, false);
|
||||
}
|
||||
|
@ -2452,7 +2456,7 @@ public class Mobibot extends PircBot
|
|||
* @param sender The nick of the person who sent the message.
|
||||
* @param symbol The stock symbol to lookup.
|
||||
*/
|
||||
private void stockResponse(String sender, String symbol)
|
||||
private void stockResponse(final String sender, final String symbol)
|
||||
{
|
||||
if (symbol.length() > 0)
|
||||
{
|
||||
|
@ -2470,7 +2474,7 @@ public class Mobibot extends PircBot
|
|||
* @param sender The sender's nick.
|
||||
* @param cmds The commands string.
|
||||
*/
|
||||
private void tellResponse(String sender, String cmds)
|
||||
private void tellResponse(final String sender, final String cmds)
|
||||
{
|
||||
if (!Utils.isValidString(cmds))
|
||||
{
|
||||
|
@ -2653,7 +2657,7 @@ public class Mobibot extends PircBot
|
|||
* @param sender The sender's nick.
|
||||
* @param message The message.
|
||||
*/
|
||||
private void twitterResponse(String sender, String message)
|
||||
private void twitterResponse(final String sender, final String message)
|
||||
{
|
||||
if (isTwitterEnabled())
|
||||
{
|
||||
|
@ -2684,7 +2688,7 @@ public class Mobibot extends PircBot
|
|||
* @param sender The nick of the person who sent the message.
|
||||
* @param isPrivate Set to true is the response should be send as a private message.
|
||||
*/
|
||||
private void usersResponse(String sender, boolean isPrivate)
|
||||
private void usersResponse(final String sender, final boolean isPrivate)
|
||||
{
|
||||
final User[] users = getUsers(channel);
|
||||
final String[] nicks = new String[users.length];
|
||||
|
@ -2717,7 +2721,7 @@ public class Mobibot extends PircBot
|
|||
* @param sender The nick of the person who sent the message.
|
||||
* @param isPrivate Set to true is the response should be send as a private message.
|
||||
*/
|
||||
private void versionResponse(String sender, boolean isPrivate)
|
||||
private void versionResponse(final String sender, final boolean isPrivate)
|
||||
{
|
||||
if (isOp(sender))
|
||||
{
|
||||
|
@ -2735,7 +2739,7 @@ public class Mobibot extends PircBot
|
|||
* @param args The view command arguments.
|
||||
* @param isPrivate Set to true is the response should be send as a private message.
|
||||
*/
|
||||
private void viewResponse(String sender, String args, boolean isPrivate)
|
||||
private void viewResponse(final String sender, final String args, final boolean isPrivate)
|
||||
{
|
||||
String lcArgs = args.toLowerCase();
|
||||
|
||||
|
@ -2838,7 +2842,7 @@ public class Mobibot extends PircBot
|
|||
* @param id The station's ID.
|
||||
* @param isPrivate Set to true is the response should be send as a private message.
|
||||
*/
|
||||
private void weatherResponse(String sender, String id, boolean isPrivate)
|
||||
private void weatherResponse(final String sender, final String id, final boolean isPrivate)
|
||||
{
|
||||
new Thread(new Weather(this, sender, id, isPrivate)).start();
|
||||
}
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
/* Created by JReleaseInfo AntTask from Open Source Competence Group */
|
||||
/* Creation date Mon Oct 26 14:39:18 PDT 2015 */
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* This class provides information gathered from the build environment.
|
||||
*
|
||||
* @author JReleaseInfo AntTask
|
||||
*/
|
||||
public class ReleaseInfo {
|
||||
|
||||
/**
|
||||
* Disables the default constructor.
|
||||
* @throws UnsupportedOperationException if the constructor is called.
|
||||
*/
|
||||
private ReleaseInfo() throws UnsupportedOperationException {
|
||||
throw new UnsupportedOperationException("Illegal constructor call.");
|
||||
}
|
||||
|
||||
|
||||
/** buildDate (set during build process to 1445895558361L). */
|
||||
private static final Date buildDate = new Date(1445895558361L);
|
||||
|
||||
/**
|
||||
* Get buildDate (set during build process to Mon Oct 26 14:39:18 PDT 2015).
|
||||
* @return Date buildDate
|
||||
*/
|
||||
public static Date getBuildDate() { return buildDate; }
|
||||
|
||||
|
||||
/** project (set during build process to "mobibot"). */
|
||||
private static final String project = "mobibot";
|
||||
|
||||
/**
|
||||
* Get project (set during build process to "mobibot").
|
||||
* @return String project
|
||||
*/
|
||||
public static String getProject() { return project; }
|
||||
|
||||
|
||||
/** version (set during build process to "0.6"). */
|
||||
private static final String version = "0.6";
|
||||
|
||||
/**
|
||||
* Get version (set during build process to "0.6").
|
||||
* @return String version
|
||||
*/
|
||||
public static String getVersion() { return version; }
|
||||
|
||||
|
||||
/**
|
||||
* Get buildNumber (set during build process to 0).
|
||||
* @return int buildNumber
|
||||
*/
|
||||
public static int getBuildNumber() { return 0; }
|
||||
|
||||
}
|
|
@ -1,35 +1,33 @@
|
|||
/*
|
||||
* StockQuote.java
|
||||
*
|
||||
* Copyright (c) 2004-2015, Erik C. Thauvin (erik@thauvin.net)
|
||||
* Copyright (c) 2004-2016, Erik C. Thauvin (erik@thauvin.net)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* Neither the name of this project nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
|
@ -75,7 +73,7 @@ class StockQuote implements Runnable
|
|||
* @param sender The nick of the person who sent the message.
|
||||
* @param symbol The stock symbol.
|
||||
*/
|
||||
public StockQuote(Mobibot bot, String sender, String symbol)
|
||||
public StockQuote(final Mobibot bot, final String sender, final String symbol)
|
||||
{
|
||||
this.bot = bot;
|
||||
this.sender = sender;
|
||||
|
|
|
@ -1,35 +1,33 @@
|
|||
/*
|
||||
* TellMessage.java
|
||||
*
|
||||
* Copyright (c) 2004-2015, Erik C. Thauvin (erik@thauvin.net)
|
||||
* Copyright (c) 2004-2016, Erik C. Thauvin (erik@thauvin.net)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* Neither the name of this project nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
|
@ -71,7 +69,7 @@ public class TellMessage implements Serializable
|
|||
* @param recipient The recipient's nick.
|
||||
* @param message The message.
|
||||
*/
|
||||
public TellMessage(String sender, String recipient, String message)
|
||||
public TellMessage(final String sender, final String recipient, final String message)
|
||||
{
|
||||
this.sender = sender;
|
||||
this.recipient = recipient;
|
||||
|
@ -149,7 +147,7 @@ public class TellMessage implements Serializable
|
|||
*
|
||||
* @return <code>true</code> if the nickname matches.
|
||||
*/
|
||||
public boolean isMatch(String nick)
|
||||
public boolean isMatch(final String nick)
|
||||
{
|
||||
return (sender.equalsIgnoreCase(nick) || recipient.equalsIgnoreCase(nick));
|
||||
}
|
||||
|
@ -161,7 +159,7 @@ public class TellMessage implements Serializable
|
|||
*
|
||||
* @return <code>true</code> if the id matches.
|
||||
*/
|
||||
public boolean isMatchId(String id)
|
||||
public boolean isMatchId(final String id)
|
||||
{
|
||||
return this.id.equals(id);
|
||||
}
|
||||
|
|
|
@ -1,35 +1,33 @@
|
|||
/*
|
||||
* TellMessagesMgr.java
|
||||
*
|
||||
* Copyright (c) 2004-2015, Erik C. Thauvin (erik@thauvin.net)
|
||||
* Copyright (c) 2004-2016, Erik C. Thauvin (erik@thauvin.net)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* Neither the name of this project nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
|
@ -48,7 +46,7 @@ import java.util.List;
|
|||
* @created 2014-04-26
|
||||
* @since 1.0
|
||||
*/
|
||||
class TellMessagesMgr
|
||||
final class TellMessagesMgr
|
||||
{
|
||||
/**
|
||||
* Disables the default constructor.
|
||||
|
@ -69,7 +67,7 @@ class TellMessagesMgr
|
|||
*
|
||||
* @return <code>True</code> if the queue was cleaned.
|
||||
*/
|
||||
public static boolean cleanTellMessages(List<TellMessage> tellMessages, int tellMaxDays)
|
||||
public static boolean cleanTellMessages(final List<TellMessage> tellMessages, final int tellMaxDays)
|
||||
{
|
||||
final Calendar maxDate = Calendar.getInstance();
|
||||
final Date today = new Date();
|
||||
|
@ -99,7 +97,7 @@ class TellMessagesMgr
|
|||
* @return The {@link net.thauvin.erik.mobibot.TellMessage} array.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static List<TellMessage> load(String file, Log4JLogger logger)
|
||||
public static List<TellMessage> load(final String file, final Log4JLogger logger)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -142,7 +140,7 @@ class TellMessagesMgr
|
|||
* @param messages The {@link net.thauvin.erik.mobibot.TellMessage} array.
|
||||
* @param logger The logger.
|
||||
*/
|
||||
public static void save(String file, List<TellMessage> messages, Log4JLogger logger)
|
||||
public static void save(final String file, final List<TellMessage> messages, final Log4JLogger logger)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
@ -1,35 +1,33 @@
|
|||
/*
|
||||
* Twitter.java
|
||||
*
|
||||
* Copyright (c) 2004-2015, Erik C. Thauvin (erik@thauvin.net)
|
||||
* Copyright (c) 2004-2016, Erik C. Thauvin (erik@thauvin.net)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* Neither the name of this project nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
|
@ -92,8 +90,8 @@ class Twitter implements Runnable
|
|||
* @param accessTokenSecret The Twitter access token secret.
|
||||
* @param message The Twitter message.
|
||||
*/
|
||||
public Twitter(Mobibot bot, String sender, String consumerKey, String consumerSecret, String accessToken,
|
||||
String accessTokenSecret, String message)
|
||||
public Twitter(final Mobibot bot, final String sender, final String consumerKey, final String consumerSecret, final String accessToken,
|
||||
final String accessTokenSecret, final String message)
|
||||
{
|
||||
this.bot = bot;
|
||||
this.consumerKey = consumerKey;
|
||||
|
|
|
@ -1,35 +1,33 @@
|
|||
/*
|
||||
* Utils.java
|
||||
*
|
||||
* Copyright (c) 2004-2015, Erik C. Thauvin (erik@thauvin.net)
|
||||
* Copyright (c) 2004-2016, Erik C. Thauvin (erik@thauvin.net)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* Neither the name of this project nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
|
|
|
@ -1,35 +1,33 @@
|
|||
/*
|
||||
* War.java
|
||||
*
|
||||
* Copyright (c) 2004-2015, Erik C. Thauvin (erik@thauvin.net)
|
||||
* Copyright (c) 2004-2016, Erik C. Thauvin (erik@thauvin.net)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* Neither the name of this project nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
|
@ -42,7 +40,7 @@ import java.util.Random;
|
|||
* @created 2014-04-28
|
||||
* @since 1.0
|
||||
*/
|
||||
class War
|
||||
final class War
|
||||
{
|
||||
/**
|
||||
* The deck of card for the {@link net.thauvin.erik.mobibot.Commands#WAR_CMD war} command.
|
||||
|
@ -72,7 +70,7 @@ class War
|
|||
* @param bot The bot's instance.
|
||||
* @param sender The sender's nickname.
|
||||
*/
|
||||
public static void play(Mobibot bot, String sender)
|
||||
public static void play(final Mobibot bot, final String sender)
|
||||
{
|
||||
final Random r = new Random();
|
||||
|
||||
|
|
|
@ -1,35 +1,33 @@
|
|||
/*
|
||||
* Weather.java
|
||||
*
|
||||
* Copyright (c) 2004-2015, Erik C. Thauvin (erik@thauvin.net)
|
||||
* Copyright (c) 2004-2016, Erik C. Thauvin (erik@thauvin.net)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* Neither the name of this project nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
|
@ -87,7 +85,7 @@ class Weather implements Runnable
|
|||
* @param station The station ID.
|
||||
* @param isPrivate Set to true is the response should be send as a private message.
|
||||
*/
|
||||
public Weather(Mobibot bot, String sender, String station, boolean isPrivate)
|
||||
public Weather(final Mobibot bot, final String sender, final String station, final boolean isPrivate)
|
||||
{
|
||||
this.bot = bot;
|
||||
this.sender = sender;
|
||||
|
|
|
@ -1,35 +1,33 @@
|
|||
/*
|
||||
* WorldTime.java
|
||||
*
|
||||
* Copyright (c) 2004-2015, Erik C. Thauvin (erik@thauvin.net)
|
||||
* Copyright (c) 2004-2016, Erik C. Thauvin (erik@thauvin.net)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
* Neither the name of this project nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
|
@ -147,7 +145,7 @@ class WorldTime
|
|||
* @param args The time command arguments.
|
||||
* @param isPrivate Set to true is the response should be send as a private message.
|
||||
*/
|
||||
public final void timeResponse(Mobibot bot, String sender, String args, boolean isPrivate)
|
||||
public final void timeResponse(final Mobibot bot, final String sender, final String args, final boolean isPrivate)
|
||||
{
|
||||
boolean isInvalidTz = false;
|
||||
final String tz = (COUNTRIES_MAP.get((args.substring(args.indexOf(' ') + 1).trim().toUpperCase())));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue