Package lombok

Examples of lombok.val.toArray()


    val result = new ReifiedArrayList<LongEntry<V>>(size, LongEntry.class);
    for (int i = 0; i < table.length; i++)
      if (table[i] != null)
        result.addAll(table[i].entries);

    return result.toArray();
  }

  /**
   * {@inheritDoc}
   *
 
View Full Code Here


  @Validate
  public static <T> T[] remove(@NotNull final T[] array, T element)
  {
    val list = new ReifiedArrayList<T>(array);
    list.remove(element);
    return list.toArray();
  }

  /**
   * Removes all occurences of element from the given array, returning an new array if found. Otherwise returns a copy of the array
   * containing all original items.
View Full Code Here

            if (array[i] == null)
              list.add(array[i]);
            else if (!array[i].equals(element))
              list.add(array[i]);

    return list.toArray();
  }

  /**
   * Removes the element at the given position from the given array.
   *
 
View Full Code Here

  {
    val result = new ReifiedArrayList<Boolean>(booleans.length, Boolean.class);
    for (boolean val : booleans)
      result.add(val);

    return result.toArray();
  }

  /**
   * Converts a byte[] to a Byte array.
   *
 
View Full Code Here

  {
    val result = new ReifiedArrayList<Byte>(bytes.length, Byte.class);
    for (byte val : bytes)
      result.add(val);

    return result.toArray();
  }

  /**
   * Converts a char[] to a Character array.
   *
 
View Full Code Here

  {
    val result = new ReifiedArrayList<Character>(chars.length, Character.class);
    for (char val : chars)
      result.add(val);

    return result.toArray();
  }

  /**
   * Converts a short[] to a Short array.
   *
 
View Full Code Here

  {
    val result = new ReifiedArrayList<Short>(shorts.length, Short.class);
    for (short val : shorts)
      result.add(val);

    return result.toArray();
  }

  /**
   * Converts a int[] to an Integer array.
   *
 
View Full Code Here

  {
    val result = new ReifiedArrayList<Integer>(ints.length, Integer.class);
    for (int val : ints)
      result.add(val);

    return result.toArray();
  }

  /**
   * Converts a long[] to a Long array.
   *
 
View Full Code Here

  {
    val result = new ReifiedArrayList<Long>(longs.length, Long.class);
    for (long val : longs)
      result.add(val);

    return result.toArray();
  }

  /**
   * Converts a float[] to a Float array.
   *
 
View Full Code Here

  {
    val result = new ReifiedArrayList<Float>(floats.length, Float.class);
    for (float val : floats)
      result.add(val);

    return result.toArray();
  }

  /**
   * Converts a double[] to a Double array.
   *
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.