Tabnine Logo
Class.toGenericString
Code IndexAdd Tabnine to your IDE (free)

How to use
toGenericString
method
in
java.lang.Class

Best Java code snippets using java.lang.Class.toGenericString (Showing top 19 results out of 315)

origin: prestodb/presto

public static Method getCombineFunction(Class<?> clazz, Class<?> stateClass)
{
  // Only include methods that match this state class
  List<Method> combineFunctions = FunctionsParserHelper.findPublicStaticMethodsWithAnnotation(clazz, CombineFunction.class).stream()
      .filter(method -> method.getParameterTypes()[AggregationImplementation.Parser.findAggregationStateParamId(method, 0)] == stateClass)
      .filter(method -> method.getParameterTypes()[AggregationImplementation.Parser.findAggregationStateParamId(method, 1)] == stateClass)
      .collect(toImmutableList());
  checkArgument(combineFunctions.size() == 1, String.format("There must be exactly one @CombineFunction in class %s for the @AggregationState %s ", clazz.toGenericString(), stateClass.toGenericString()));
  return getOnlyElement(combineFunctions);
}
origin: prestodb/presto

private static Optional<Method> getAggregationStateSerializerFactory(Class<?> aggregationDefinition, Class<?> stateClass)
{
  // Only include methods that match this state class
  List<Method> stateSerializerFactories = FunctionsParserHelper.findPublicStaticMethodsWithAnnotation(aggregationDefinition, AggregationStateSerializerFactory.class).stream()
      .filter(method -> ((AggregationStateSerializerFactory) method.getAnnotation(AggregationStateSerializerFactory.class)).value().equals(stateClass))
      .collect(toImmutableList());
  if (stateSerializerFactories.isEmpty()) {
    return Optional.empty();
  }
  checkArgument(stateSerializerFactories.size() == 1,
      String.format(
          "Expect at most 1 @AggregationStateSerializerFactory(%s.class) annotation, found %s in %s",
          stateClass.toGenericString(),
          stateSerializerFactories.size(),
          aggregationDefinition.toGenericString()));
  return Optional.of(getOnlyElement(stateSerializerFactories));
}
origin: stackoverflow.com

 import java.util.ArrayList;

class MyClass {
  ArrayList<String> stringList;

  public ArrayList<String> getStringList() {
    return stringList;
  }
}

public class Foo {
  public static void main(String... args) throws NoSuchMethodException {
    ArrayList<Integer> intList = new ArrayList<>();
    System.out.println(intList.getClass().toGenericString());  
    System.out.println(MyClass.class.getMethod("getStringList").toGenericString());
  }
}
origin: prestosql/presto

public static Method getCombineFunction(Class<?> clazz, Class<?> stateClass)
{
  // Only include methods that match this state class
  List<Method> combineFunctions = FunctionsParserHelper.findPublicStaticMethodsWithAnnotation(clazz, CombineFunction.class).stream()
      .filter(method -> method.getParameterTypes()[AggregationImplementation.Parser.findAggregationStateParamId(method, 0)] == stateClass)
      .filter(method -> method.getParameterTypes()[AggregationImplementation.Parser.findAggregationStateParamId(method, 1)] == stateClass)
      .collect(toImmutableList());
  checkArgument(combineFunctions.size() == 1, String.format("There must be exactly one @CombineFunction in class %s for the @AggregationState %s ", clazz.toGenericString(), stateClass.toGenericString()));
  return getOnlyElement(combineFunctions);
}
origin: in.erail/glue

@Override
public String toString() {
 return MoreObjects
     .toStringHelper(this)
     .add("mFactoryClass", mFactoryClass)
     .add("mFactoryInstance", mFactoryInstance)
     .add("mFactoryMethodName", mFactoryMethodName)
     .add("mFactoryParamValues", mFactoryParamValues != null ? Joiner.on(",").join(mFactoryParamValues) : null)
     .add("mFactoryParamType", mFactoryParamType != null ? Joiner.on(",").join(mFactoryParamType) : null)
     .add("mParamType", mParamType != null ? Joiner.on(",").join(mParamType) : null)
     .add("mComponentPath", mComponentPath)
     .add("mFactoryEnable", mFactoryEnable)
     .add("mMethod", mMethod != null ? mMethod.getName() : null)
     .add("mMethodParam", mMethodParam != null ? Joiner.on(",").join(mMethodParam) : null)
     .add("mMethodClass", mMethodClass != null ? mMethodClass.getCanonicalName() : null)
     .add("mMethodClassInstance", mMethodClassInstance != null ? mMethodClassInstance.getClass().toGenericString() : null)
     .toString();
}
origin: io.prestosql/presto-main

public static Method getCombineFunction(Class<?> clazz, Class<?> stateClass)
{
  // Only include methods that match this state class
  List<Method> combineFunctions = FunctionsParserHelper.findPublicStaticMethodsWithAnnotation(clazz, CombineFunction.class).stream()
      .filter(method -> method.getParameterTypes()[AggregationImplementation.Parser.findAggregationStateParamId(method, 0)] == stateClass)
      .filter(method -> method.getParameterTypes()[AggregationImplementation.Parser.findAggregationStateParamId(method, 1)] == stateClass)
      .collect(toImmutableList());
  checkArgument(combineFunctions.size() == 1, String.format("There must be exactly one @CombineFunction in class %s for the @AggregationState %s ", clazz.toGenericString(), stateClass.toGenericString()));
  return getOnlyElement(combineFunctions);
}
origin: io.prestosql/presto-main

private static Optional<Method> getAggregationStateSerializerFactory(Class<?> aggregationDefinition, Class<?> stateClass)
{
  // Only include methods that match this state class
  List<Method> stateSerializerFactories = FunctionsParserHelper.findPublicStaticMethodsWithAnnotation(aggregationDefinition, AggregationStateSerializerFactory.class).stream()
      .filter(method -> ((AggregationStateSerializerFactory) method.getAnnotation(AggregationStateSerializerFactory.class)).value().equals(stateClass))
      .collect(toImmutableList());
  if (stateSerializerFactories.isEmpty()) {
    return Optional.empty();
  }
  checkArgument(stateSerializerFactories.size() == 1,
      String.format(
          "Expect at most 1 @AggregationStateSerializerFactory(%s.class) annotation, found %s in %s",
          stateClass.toGenericString(),
          stateSerializerFactories.size(),
          aggregationDefinition.toGenericString()));
  return Optional.of(getOnlyElement(stateSerializerFactories));
}
origin: NyaaCat/RPGItems-reloaded

  public static void registerOverride(NamespacedKey origin, NamespacedKey override) {
    if (overrides.containsKey(origin)) {
      throw new IllegalArgumentException("Cannot override a already overridden power: " + origin + " " + override);
    }
    Class<? extends Power> originPower = getPower(origin);
    Class<? extends Power> overridePower = getPower(override);
    if (originPower == null) {
      throw new IllegalArgumentException("Overriding not registered power: " + origin);
    }
    if (overridePower == null) {
      throw new IllegalArgumentException("Override not found: " + override);
    }
    if (!originPower.isAssignableFrom(overridePower)) {
      throw new IllegalArgumentException("Not overrideable: " + origin + "@" + originPower.toGenericString() + " " + override + "@" + overridePower.toGenericString());
    }
    overrides.put(origin, override);
  }
}
origin: bonitasoft/bonita-engine

  public Object invokeJavaMethod(final String typeOfValueToSet, final Object valueToSetObjectWith, final Object objectToInvokeJavaMethodOn,
      final String operator, final String operatorParameterClassName) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
      IllegalArgumentException, InvocationTargetException {
    final Class<?> expressionResultType = getClassOrPrimitiveClass(typeOfValueToSet);
    final Class<?> dataType = Thread.currentThread().getContextClassLoader().loadClass(objectToInvokeJavaMethodOn.getClass().getName());
    final Method method = MethodUtils.getMatchingAccessibleMethod(dataType, operator, new Class[]{getClassOrPrimitiveClass(operatorParameterClassName)});
    if (method != null) {
      final Object o = dataType.cast(objectToInvokeJavaMethodOn);
      method.invoke(o, expressionResultType.cast(valueToSetObjectWith));
      return o;
    } else {
      throw new NoSuchMethodException(dataType.toGenericString() + "." + operator + "(" + operatorParameterClassName + ").");
    }
  }
}
origin: prestosql/presto

private static Optional<Method> getAggregationStateSerializerFactory(Class<?> aggregationDefinition, Class<?> stateClass)
{
  // Only include methods that match this state class
  List<Method> stateSerializerFactories = FunctionsParserHelper.findPublicStaticMethodsWithAnnotation(aggregationDefinition, AggregationStateSerializerFactory.class).stream()
      .filter(method -> ((AggregationStateSerializerFactory) method.getAnnotation(AggregationStateSerializerFactory.class)).value().equals(stateClass))
      .collect(toImmutableList());
  if (stateSerializerFactories.isEmpty()) {
    return Optional.empty();
  }
  checkArgument(stateSerializerFactories.size() == 1,
      String.format(
          "Expect at most 1 @AggregationStateSerializerFactory(%s.class) annotation, found %s in %s",
          stateClass.toGenericString(),
          stateSerializerFactories.size(),
          aggregationDefinition.toGenericString()));
  return Optional.of(getOnlyElement(stateSerializerFactories));
}
origin: neuhalje/bouncy-gpg

/**
 * The default strategy to search for keys is to *just* search for the email address (the part
 * between &lt; and &gt;).
 *
 * Set this flag to search for any part in the user id.
 *
 * @param strategy instance to use
 *
 * @return next build step
 */
public WithAlgorithmSuite withKeySelectionStrategy(final KeySelectionStrategy strategy) {
 requireNonNull(strategy, "strategy must not be null");
 Preconditions.checkState(
   selectUidByEMailOnly == null && dateOfTimestampVerification == null,
   "selectUidByAnyUidPart/setReferenceDateForKeyValidityTo cannot be used together"
     + " with 'withKeySelectionStrategy' ");
 this.keySelectionStrategy = strategy;
 LOGGER.trace("WithKeySelectionStrategy: override strategy to {}",
   strategy.getClass().toGenericString());
 return this;
}
origin: bonitasoft/bonita-engine

  public Object invokeJavaMethod(final String typeOfValueToSet, final Object valueToSetObjectWith, final Object objectToInvokeJavaMethodOn,
      final String operator, final String operatorParameterClassName) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
      IllegalArgumentException, InvocationTargetException {
    final Class<?> expressionResultType = getClassOrPrimitiveClass(typeOfValueToSet);
    final Class<?> dataType = Thread.currentThread().getContextClassLoader().loadClass(objectToInvokeJavaMethodOn.getClass().getName());
    final Method method = MethodUtils.getMatchingAccessibleMethod(dataType, operator, new Class[]{getClassOrPrimitiveClass(operatorParameterClassName)});
    if (method != null) {
      final Object o = dataType.cast(objectToInvokeJavaMethodOn);
      method.invoke(o, expressionResultType.cast(valueToSetObjectWith));
      return o;
    } else {
      throw new NoSuchMethodException(dataType.toGenericString() + "." + operator + "(" + operatorParameterClassName + ").");
    }
  }
}
origin: org.jrebirth.af/core

/**
 * Gets the value.
 *
 * @param object the object
 * @param method the method
 * @param cls the cls
 * 
 * @param <T> the generic type
 * 
 * @return the value
 */
@SuppressWarnings("unchecked")
private <T> Optional<T> getValue(Object object, Supplier<Object> method, Class<T> cls) {
  T source = null;
  if (cls.isInstance(method.get())) {
    source = (T) method.get();
  } else {
    if (CoreParameters.DEVELOPER_MODE.get()) {
      throw new CoreRuntimeException("Cannot cast object " + method.get() + " to " + cls.toGenericString());
    }
  }
  return Optional.ofNullable(source);
}
origin: org.apache.polygene.core/org.apache.polygene.core.api

@Override
public String getMessage()
{
  String typeNames = typesString();
  String primary = primaryType == null ? "" : "    primary: " + primaryType.toGenericString() + NL;
  String methodName = memberString();
  String message = super.getMessage() == null ? "" : "    message: " + super.getMessage() + NL;
  String fragment = fragmentClass == null ? "" : "    fragmentClass: " + fragmentClass.getName() + NL;
  String valueType = this.valueType == null ? "" : "    valueType: " + this.valueType.getTypeName() + NL;
  String module = this.module == null ? "" : "    layer: " + this.module.layer().name() + NL + "    module: "
                        + this.module.name() + NL;
  return message + module + primary + fragment + methodName + valueType + typeNames;
}
origin: apache/attic-polygene-java

@Override
public String getMessage()
{
  String typeNames = typesString();
  String primary = primaryType == null ? "" : "    primary: " + primaryType.toGenericString() + NL;
  String methodName = memberString();
  String message = super.getMessage() == null ? "" : "    message: " + super.getMessage() + NL;
  String fragment = fragmentClass == null ? "" : "    fragmentClass: " + fragmentClass.getName() + NL;
  String valueType = this.valueType == null ? "" : "    valueType: " + this.valueType.getTypeName() + NL;
  String module = this.module == null ? "" : "    layer: " + this.module.layer().name() + NL + "    module: "
                        + this.module.name() + NL;
  return message + module + primary + fragment + methodName + valueType + typeNames;
}
origin: eclipse/kapua

  /**
   * Check the exception that was caught. In case the exception was expected the type and message is shown in the cucumber logs.
   * Otherwise the exception is rethrown failing the test and dumping the stack trace to help resolving problems.
   */
  public void verifyException(Exception ex)
      throws Exception {

    boolean exceptionExpected = stepData.contains("ExceptionExpected") ? (boolean)stepData.get("ExceptionExpected") : false;
    String exceptionName = stepData.contains("ExceptionName") ? (String)stepData.get("ExceptionName") : "";
    String exceptionMessage = stepData.contains("ExceptionMessage") ? (String)stepData.get("ExceptionMessage") : "";

    if (!exceptionExpected ||
        (!exceptionName.isEmpty() && !ex.getClass().toGenericString().contains(exceptionName)) ||
        (!exceptionMessage.isEmpty() && !exceptionMessage.trim().contentEquals("*") && !ex.getMessage().contains(exceptionMessage))) {
      scenario.write("An unexpected exception was raised!");
      throw(ex);
    }

    scenario.write("Exception raised as expected: " + ex.getClass().getCanonicalName() + ", " + ex.getMessage());
    stepData.put("ExceptionCaught", true);
    stepData.put("Exception", ex);
  }
}
origin: waterguo/antsdb

@Override
public long eval(VdmContext ctx, Heap heap, Parameters params, long pRecord) {
  long addrVal = this.upstream.eval(ctx, heap, params, pRecord);
  Object val = FishObject.get(heap, addrVal);
  if (val == null) {
  }
  else if (val instanceof Float) {
  }
  else if (val instanceof Long) {
    val = ((Long)val).floatValue();
  }
  else if (val instanceof String) {
    val = Float.valueOf((String)val);
  }
  else if (val instanceof BigDecimal) {
    val = ((BigDecimal)val).floatValue();
  }
  else if (val instanceof Double) {
    val = ((Double)val).floatValue();
  }
  else {
    throw new CodingError(val.getClass().toGenericString());
  }
  return FishObject.allocSet(heap, val);
}
origin: apache/attic-polygene-java

+ method.toGenericString()
+ NL + "Declaring Class:"
+ method.getDeclaringClass().toGenericString()
+ NL + "Types:"
+ mixinsModel.mixinTypes()
origin: waterguo/antsdb

throw new CodingError(val.getClass().toGenericString());
java.langClasstoGenericString

Popular methods of Class

  • getName
    Returns the name of the class represented by this Class. For a description of the format which is us
  • getSimpleName
  • getClassLoader
  • isAssignableFrom
    Determines if the class or interface represented by this Class object is either the same as, or is a
  • forName
    Returns the Class object associated with the class or interface with the given string name, using th
  • newInstance
    Returns a new instance of the class represented by this Class, created by invoking the default (that
  • getMethod
    Returns a Method object that reflects the specified public member method of the class or interface r
  • getResourceAsStream
    Finds a resource with a given name. The rules for searching resources associated with a given class
  • getSuperclass
    Returns the Class representing the superclass of the entity (class, interface, primitive type or voi
  • getConstructor
  • cast
    Casts an object to the class or interface represented by this Class object.
  • isInstance
  • cast,
  • isInstance,
  • getCanonicalName,
  • getDeclaredField,
  • isArray,
  • getAnnotation,
  • getDeclaredFields,
  • getResource,
  • getDeclaredMethod,
  • getMethods

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (Timer)
  • notifyDataSetChanged (ArrayAdapter)
  • getSharedPreferences (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • JFileChooser (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now