Package lombok

Examples of lombok.val


  /**
   * Casts a sequence of values of a certain type to an array of values of another type, discarding elements that are not cast successfully.
   */
  private static <TSource, TDest> void castRemove(final TSource[] values, final ReifiedList<TDest> list)
  {
    val destinationClass = list.getGenericTypeParameter();
    for (TSource v : values)
    {
      TDest castVal;
      try
      {
        castVal = (TDest) destinationClass.cast(v);
      }
      catch(ClassCastException e)
      {
        // remove upon any failure
        continue;
View Full Code Here


   *
   * @throws NullPointerException An argument is null.
   */
  private static <TSource, TDest> void castUseDefault(final TSource[] values, final ReifiedList<TDest> list)
  {
    val destinationClass = list.getGenericTypeParameter();

    val count = values.length;
    for (int i = 0; i < count; i++)
    {
      TDest castVal;
      try
      {
View Full Code Here

  /**
   * Returns true if a non-null item is contained in the sequence of values
   */
  private static <T> boolean containsNonNull(final T[] values, final T item)
  {
    val count = values.length;
    for (int i = 0; i < count; i++)
    {
      T v = values[i];
      // if a value is null, we cannot use equals
      if (v != null)
View Full Code Here

  /**
   * Returns true if a non-null item is contained in the sequence of values
   */
  private static <T> boolean containsNonNull(final T[] values, final T item, final Comparator<? super T> comparer)
  {
    val count = values.length;
    for (int i = 0; i < count; i++)
    {
      T v = values[i];
      // if a value is null, we cannot use equals
      if (v != null)
View Full Code Here

  /**
   * Returns true if null is contained in the sequence of values
   */
  private static <T> boolean containsNull(final T[] values)
  {
    val count = values.length;
    for (int i = 0; i < count; i++)
      if (values[i] == null)
        return true;

    return false;
View Full Code Here

  {
    // check if value contained in sequence
    int result = 0;

    // the values is confirmed to be a non-null IEnumerable prior to this
    val count = values.length;
    for (int i = 0; i < count; i++)
      if (values[i] == null)
        result++;

    return result;
View Full Code Here

  {
    // check if value contained collection
    int result = 0;

    // the values is confirmed to be a non-null IEnumerable prior to this
    val count = values.length;
    for (int i = 0; i < count; i++)
    {
      T v = values[i];
      if (v != null)
        if (v.equals(value))
View Full Code Here

  {
    // check if value contained collection
    int result = 0;

    // the values is confirmed to be a non-null IEnumerable prior to this
    val count = values.length;
    for (int i = 0; i < count; i++)
    {
      T v = values[i];
      if (v != null)
        if (comparer.compare(v, value) == 0)
View Full Code Here

  /**
   * Returns the index where the specified not-null element is first found. If the element is not found, this returns -1.
   */
  private static <T> int indexOfNotNull(final T[] values, final T element)
  {
    val count = values.length;
    for (int i = 0; i < count; i++)
    {
      if (element.equals(values[i]))
        return i;
    }
View Full Code Here

  /**
   * Returns the index where the specified not-null element is first found. If the element is not found, this returns -1.
   */
  private static <T> int indexOfNotNull(final T[] values, final T element, final Comparator<? super T> comparer)
  {
    val count = values.length;
    for (int i = 0; i < count; i++)
    {
      if (comparer.compare(element, values[i]) == 0)
        return i;
    }
View Full Code Here

TOP

Related Classes of lombok.val

Copyright © 2018 www.massapicom. 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.