Returns the first non-null object produced by the given converters.
Returns null if no such object found.
976532
@SafeVarargs
  private static <T> Object toObject( T value, Function<T,Object>... converters)
    {
    return
      Stream.of( converters)
      .map( converter -> converter.apply( value))
      .filter( Objects::nonNull)
      .findFirst()
      .orElse( null);
    }
67530
<C> Converter<A, C> doAndThen(Converter<B, C> secondConverter) {
		return new ConverterComposition<A, B, C>(this, checkNotNull(secondConverter));
	}
218102
def get_referenced_object(self):
        

        if self._DeviceServer is not None:
            return self._DeviceServer

        raise exception.BunqException(self._ERROR_NULL_FIELDS)
142596
def get_default_object_converters(conversion_finder: ConversionFinder) \
        -> List[Union[Converter[Any, Type[None]], Converter[Type[None], Any]]]:
    

    return [
            ConverterFunction(from_type=b64str, to_type=AnyObject, conversion_method=base64_ascii_str_pickle_to_object),
            ConverterFunction(from_type=DictOfDict, to_type=Any, conversion_method=dict_to_object,
                              custom_name='dict_of_dict_to_object',
                              is_able_to_convert_func=_is_valid_for_dict_to_object_conversion, unpack_options=False,
                              function_args={'conversion_finder': conversion_finder, 'is_dict_of_dicts': True}),
            ConverterFunction(from_type=dict, to_type=AnyObject, conversion_method=dict_to_object,
                              custom_name='dict_to_object', unpack_options=False,
                              is_able_to_convert_func=_is_valid_for_dict_to_object_conversion,
                              function_args={'conversion_finder': conversion_finder, 'is_dict_of_dicts': False})
            ]
779923
private <T> Converter<T> lookupConverter(Type targetType)
    {
        // Try with complete type
        Converter<T> converter = getConverter(targetType);

        // Try with simple class
        if (converter == null && targetType instanceof ParameterizedType) {
            Class<?> targetClass = ReflectionUtils.getTypeClass(targetType);
            converter = getConverter(targetClass);
        }

        if (converter == null) {
            if (targetType instanceof Class && Enum.class.isAssignableFrom((Class<?>) targetType)) {
                // It's an Enum
                converter = (Converter<T>) this.enumConverter;
            } else {
                // Fallback on default converter

                this.logger.debug("Using the default Converter for type [{}]", targetType);

                converter = this.defaultConverter;
            }
        }

        return converter;
    }
568824
private ConvertFrom<String> converter()
  {
    ConvertFromBuilder<String> builder = ConvertStringDefault.build();

    builder.add(new ConvertStringToPath());

    return builder.get();
  }
479190
public Converter<NetworkResponse, ?> getResponseConverter(Type type, Annotation[] annotations) {
        checkNotNull(type, "type == null");
        checkNotNull(annotations, "annotations == null");

        for (int i = 0, count = converterFactories.size(); i < count; i++) {
            Converter<NetworkResponse, ?> converter =
                    converterFactories.get(i).fromResponse(type, annotations);
            if (converter != null) {
                return converter;
            }
        }

        StringBuilder builder = new StringBuilder("Could not locate Response converter for ")
                .append(type)
                .append(". Tried:");
        for (Factory converterFactory : converterFactories) {
            builder.append("\n * ").append(converterFactory.getClass().getName());
        }
        throw new IllegalArgumentException(builder.toString());
    }
255540
public Converter getDefaultConverter() {
        if (getPm().getDefaultConverter() == null) {
            Converter c = new GenericConverter();
            Properties properties = new Properties();
            properties.put("filename", "converters/show.tostring.converter");
            c.setProperties(properties);
            return c;
        } else {
            return getPm().getDefaultConverter();
        }
    }
526557
public Converter getConverterToPass(int iIndex)
    {
        if (iIndex == -1)
            return super.getNextConverter();
        if (m_vconvDependent != null)
        {
            if (iIndex < m_vconvDependent.size())
                return (Converter)m_vconvDependent.get(iIndex);
        }
        return null;        // Use the next converter on the chain
    }
1280413
@Override
    public StringConverter<?> findConverter(Class<?> cls) {
        if (cls.isArray()) {
            if (cls == Long[].class) {
                return LongArrayStringConverter.INSTANCE;
            }
            if (cls == Integer[].class) {
                return IntArrayStringConverter.INSTANCE;
            }
            if (cls == Short[].class) {
                return ShortArrayStringConverter.INSTANCE;
            }
            if (cls == Double[].class) {
                return DoubleArrayStringConverter.INSTANCE;
            }
            if (cls == Float[].class) {
                return FloatArrayStringConverter.INSTANCE;
            }
        }
        return null;
    }
241686
public InstantConverter removeInstantConverter(InstantConverter converter)
            throws SecurityException {
        
        checkAlterInstantConverters();
        if (converter == null) {
            return null;
        }
        InstantConverter[] removed = new InstantConverter[1];
        iInstantConverters = iInstantConverters.remove(converter, removed);
        return removed[0];
    }
374233
function getChainConverter(first, second) {
  if (first.to !== second.from) {
    throw new Error('Chain convert impossible: ' + first.to + '!=' + second.from);
  }
  return {
    from: first.from,
    to: second.to,
    exec: function(data, conversionContext) {
      var intermediate = first.exec(data, conversionContext);
      return second.exec(intermediate, conversionContext);
    }
  };
}
562098
@Override
    public StringConverter<?> findConverter(Class<?> cls) {
        if (cls == Boolean[].class) {
            return BooleanArrayStringConverter.INSTANCE;
        }
        return null;
    }
1083819
public static <T> T firstNotNull(final T... objects) {
        for (final T object : objects) {
            if (object != null) {
                return object;
            }
        }
        return null;
    }
1230154
public InstantConverter getInstantConverter(Object object) {
        InstantConverter converter =
            (InstantConverter)iInstantConverters.select(object == null ? null : object.getClass());
        if (converter != null) {
            return converter;
        }
        throw new IllegalArgumentException("No instant converter found for type: " +
            (object == null ? "null" : object.getClass().getName()));
    }
954054
private PermConverter getConverter(HttpServletRequest hreq) {
		if(mapPairs!=null) {
			String pi = hreq.getPathInfo();
			if(pi!=null) {
			for(Pair p: mapPairs) {
				if(pi.startsWith(p.name))return p.pc;
			}
			}
		}
		return NullPermConverter.singleton();
	}
403863
@SuppressWarnings("unchecked")
    private static <T> Converter<Object, T> lookupConversionService(Class from, Class to) {
        for (ConversionProvider converter : convServices) {
            Converter c = converter.getConverter(from, to);
            if (c != null) {
                return c;
            }
        }
        return null;
    }