Skip to content

Commit

Permalink
Merge branch 'release/4.31'
Browse files Browse the repository at this point in the history
  • Loading branch information
astrapi69 committed Jun 26, 2018
2 parents 59c1ffd + 9df828c commit 67617db
Show file tree
Hide file tree
Showing 20 changed files with 396 additions and 56 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
## Change log
----------------------

Version 4.31
-------------

ADDED:

- new factory methods with initial capacity for create set objects created
- new factory methods for primitive array types created

Version 4.30.1
-------------

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</parent>

<artifactId>silly-collections</artifactId>
<version>4.30.1</version>
<version>4.31</version>

<name>${project.artifactId}</name>

Expand Down
121 changes: 121 additions & 0 deletions src/main/java/de/alpharogroup/collections/array/ArrayFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,125 @@ public static Integer[] newRangeArray(final int start, final int end)
return array;
}

/**
* Factory method for create new array of primitive boolean values from the given optional
* elements.
*
* @param elements
* the optional primitive boolean values that will be in the returned array of
* primitive boolean values array.
* @return the new array of primitive boolean values
*/
@SafeVarargs
public static boolean[] newBooleanArray(final boolean... elements)
{
return elements;
}

/**
* Factory method for create new array of primitive byte values from the given optional
* elements.
*
* @param elements
* the optional primitive byte values that will be in the returned array of primitive
* byte values array.
* @return the new array of primitive byte values
*/
@SafeVarargs
public static byte[] newByteArray(final byte... elements)
{
return elements;
}

/**
* Factory method for create new array of primitive character values from the given optional
* elements.
*
* @param elements
* the optional primitive character values that will be in the returned array of
* primitive character values array.
* @return the new array of primitive character values
*/
@SafeVarargs
public static char[] newCharArray(final char... elements)
{
return elements;
}

/**
* Factory method for create new array of primitive integer values from the given optional
* elements.
*
* @param elements
* the optional primitive integer values that will be in the returned array of
* primitive integer values array.
* @return the new array of primitive integer values
*/
@SafeVarargs
public static int[] newIntArray(final int... elements)
{
return elements;
}

/**
* Factory method for create new array of primitive long values from the given optional
* elements.
*
* @param elements
* the optional primitive long values that will be in the returned array of primitive
* long values array.
* @return the new array of primitive long values
*/
@SafeVarargs
public static long[] newLongArray(final long... elements)
{
return elements;
}

/**
* Factory method for create new array of primitive float values from the given optional
* elements.
*
* @param elements
* the optional primitive float values that will be in the returned array of
* primitive float values array.
* @return the new array of primitive float values
*/
@SafeVarargs
public static float[] newFloatArray(final float... elements)
{
return elements;
}

/**
* Factory method for create new array of primitive double values from the given optional
* elements.
*
* @param elements
* the optional primitive double values that will be in the returned array of
* primitive double values array.
* @return the new array of primitive double values
*/
@SafeVarargs
public static double[] newDoubleArray(final double... elements)
{
return elements;
}

/**
* Factory method for create new array of primitive short values from the given optional
* elements.
*
* @param elements
* the optional primitive short values that will be in the returned array of
* primitive short values array.
* @return the new array of primitive short values
*/
@SafeVarargs
public static short[] newShortArray(final short... elements)
{
return elements;
}


}
12 changes: 6 additions & 6 deletions src/main/java/de/alpharogroup/collections/pairs/Quattro.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@ public class Quattro<TL, TR, BL, BR> implements Serializable
*/
private static final long serialVersionUID = 1L;

/** The top left value. */
TL topLeft;

/** The top right value. */
TR topRight;

/** The bottom left value. */
BL bottomLeft;

/** The bottom right value. */
BR bottomRight;

/** The top left value. */
TL topLeft;

/** The top right value. */
TR topRight;

}
64 changes: 53 additions & 11 deletions src/main/java/de/alpharogroup/collections/set/SetFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,23 @@ public static final <T> Set<T> newHashSet(final Collection<T> collection, final
*
* @param <T>
* the generic type of the elements
* @param initialCapacity
* the initial capacity
* @return the new {@link HashSet}
*/
public static final <T> Set<T> newHashSet(final int initialCapacity)
{
return new HashSet<>(initialCapacity);
}

/**
* Factory method for create new {@link LinkedHashSet} and will be returned as {@link Set}
*
* @param <T>
* the generic type of the elements
* @param elements
* the elements to add in the new {@link HashSet}
* @return the new {@link HashSet}
* @return the new {@link LinkedHashSet}
*/
@SafeVarargs
public static final <T> Set<T> newLinkedHashSet(final T... elements)
Expand All @@ -104,14 +118,28 @@ public static final <T> Set<T> newLinkedHashSet(final T... elements)
}

/**
* Factory method for create new {@link HashSet} and will be returned as {@link Set}
* Factory method for create new {@link LinkedHashSet} and will be returned as {@link Set}
*
* @param <T>
* the generic type of the elements
* @param initialCapacity
* the initial capacity
* @return the new {@link LinkedHashSet}
*/
public static final <T> Set<T> newLinkedHashSet(final int initialCapacity)
{
return new LinkedHashSet<>(initialCapacity);
}

/**
* Factory method for create new {@link LinkedHashSet} and will be returned as {@link Set}
*
* @param <T>
* the generic type of the elements
* @param collection
* the optional collection that will be added to the new list
* @param elements
* the elements to add in the new {@link HashSet}
* the elements to add in the new {@link LinkedHashSet}
* @return the new {@link HashSet}
*/
@SafeVarargs
Expand All @@ -135,13 +163,13 @@ public static final <T> Set<T> newLinkedHashSet(final Collection<T> collection,
}

/**
* Factory method for create new {@link HashSet} and will be returned as {@link Set}
* Factory method for create new {@link InsertionOrderSet} and will be returned as {@link Set}
*
* @param <T>
* the generic type of the elements
* @param elements
* the elements to add in the new {@link HashSet}
* @return the new {@link HashSet}
* the elements to add in the new {@link InsertionOrderSet}
* @return the new {@link InsertionOrderSet}
*/
@SafeVarargs
public static final <T> Set<T> newInsertionOrderSet(final T... elements)
Expand All @@ -150,15 +178,29 @@ public static final <T> Set<T> newInsertionOrderSet(final T... elements)
}

/**
* Factory method for create new {@link HashSet} and will be returned as {@link Set}
* Factory method for create new {@link InsertionOrderSet} and will be returned as {@link Set}
*
* @param <T>
* the generic type of the elements
* @param initialCapacity
* the initial capacity
* @return the new {@link InsertionOrderSet}
*/
public static final <T> Set<T> newInsertionOrderSet(final int initialCapacity)
{
return new InsertionOrderSet<>(initialCapacity);
}

/**
* Factory method for create new {@link InsertionOrderSet} and will be returned as {@link Set}
*
* @param <T>
* the generic type of the elements
* @param collection
* the optional collection that will be added to the new list
* @param elements
* the elements to add in the new {@link HashSet}
* @return the new {@link HashSet}
* the elements to add in the new {@link InsertionOrderSet}
* @return the new {@link InsertionOrderSet}
*/
@SafeVarargs
public static final <T> Set<T> newInsertionOrderSet(final Collection<T> collection,
Expand Down Expand Up @@ -187,7 +229,7 @@ public static final <T> Set<T> newInsertionOrderSet(final Collection<T> collecti
* the generic type of the elements
* @param elements
* the elements to add in the new {@link TreeSet}
* @return the new {@link TreeSet}
* @return the new {@link SortedSet}
*/
@SafeVarargs
public static final <T> SortedSet<T> newTreeSet(final T... elements)
Expand All @@ -204,7 +246,7 @@ public static final <T> SortedSet<T> newTreeSet(final T... elements)
* the optional collection that will be added to the new list
* @param elements
* the elements to add in the new {@link TreeSet}
* @return the new {@link TreeSet}
* @return the new {@link SortedSet}
*/
@SafeVarargs
public static final <T> SortedSet<T> newTreeSet(final Collection<T> collection,
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/de/alpharogroup/comparators/CompareOrder.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
*/
public enum CompareOrder
{
/** The order to sort an object after. */
AFTER(1),
/** The order to sort an object before. */
BEFORE(-1),
/** The order to sort an object as equal. */
EQUAL(0),
/** The order to sort an object after. */
AFTER(1);
EQUAL(0);

/** The order. */
@Getter
Expand Down
Loading

0 comments on commit 67617db

Please sign in to comment.