Refactor methods (small).

This commit is contained in:
Christian P. MOMON 2015-09-21 13:03:44 +02:00
parent e8e29cb938
commit cd9e30def7

View file

@ -20,7 +20,6 @@ package fr.devinsy.util.strings;
import java.util.Collection; import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
import java.util.List;
/** /**
* This class is a set of String objects with specific methods. It makes * This class is a set of String objects with specific methods. It makes
@ -127,7 +126,7 @@ public class StringSet extends HashSet<String>
/** /**
* *
*/ */
public StringSet append(final StringSet strings) public StringSet add(final StringSet strings)
{ {
StringSet result; StringSet result;
@ -235,24 +234,6 @@ public class StringSet extends HashSet<String>
return result; return result;
} }
/**
*
*/
public StringSet put(final Double value)
{
StringSet result;
if (value != null)
{
this.put(String.valueOf(value));
}
result = this;
//
return result;
}
/** /**
* *
*/ */
@ -269,19 +250,11 @@ public class StringSet extends HashSet<String>
/** /**
* *
*/ */
public StringSet put(final List<String> strings) public StringSet put(final long value)
{ {
StringSet result; StringSet result;
if (strings != null) result = this.put(String.valueOf(value));
{
for (String string : strings)
{
this.put(string);
}
}
result = this;
// //
return result; return result;
@ -290,11 +263,16 @@ public class StringSet extends HashSet<String>
/** /**
* *
*/ */
public StringSet put(final long value) public StringSet put(final Object value)
{ {
StringSet result; StringSet result;
result = this.put(String.valueOf(value)); if (value != null)
{
this.put(value.toString());
}
result = this;
// //
return result; return result;
@ -381,6 +359,28 @@ public class StringSet extends HashSet<String>
return result; return result;
} }
/**
*
*/
public StringSet putNullable(final Object value)
{
StringSet result;
if (value == null)
{
super.add((String) null);
}
else
{
this.put(value.toString());
}
result = this;
//
return result;
}
/** /**
* *
*/ */