Examples of convertTo()


Examples of com.alibaba.wasp.jdbc.value.Value.convertTo()

      int type = DataType.convertSQLTypeToValueType(targetSqlType);
      if (x == null) {
        setParameter(parameterIndex, ValueNull.INSTANCE);
      } else {
        Value v = DataType.convertToValue(conn.getSession(), x, type);
        setParameter(parameterIndex, v.convertTo(type));
      }
    } catch (Exception e) {
      throw Logger.logAndConvert(log, e);
    }
  }
View Full Code Here

Examples of com.bluesoft.util.metrics.core.Rate.convertTo()

   */
  @Override
  public Rate getRate() {
    Rate r = delegate.getRate();
    if ( r.getUnit() != getRateUnit() ) {
      return r.convertTo( getRateUnit() );
    }
    return r;
  }

  protected void _reset() {
View Full Code Here

Examples of com.bluesoft.util.metrics.core.Timing.convertTo()

   */
  @Override
  public Timing getMean() {
    Timing t = delegate.getMean();
    if ( t.getUnit() != timeUnit ) {
      return t.convertTo( timeUnit );
    }
    return t;
  }

  /**
 
View Full Code Here

Examples of com.firefly.utils.json.Parser.convertTo()

  }
 
  @SuppressWarnings("unchecked")
  public static <T> T toObject(JsonReader reader, Class<?> clazz) throws IOException {
    Parser parser = getParser(clazz);
    return (T) parser.convertTo(reader, clazz);
  }
}
View Full Code Here

Examples of com.firefly.utils.json.Serializer.convertTo()

      return;
    }

    Class<?> clazz = obj.getClass();
    Serializer serializer = getSerializer(clazz);
    serializer.convertTo(writer, obj);
  }
}
View Full Code Here

Examples of com.github.sommeri.less4j.core.ast.NumberExpression.convertTo()

  private TypesConversionUtils conversionUtils = new TypesConversionUtils();

  @Override
  protected Expression evaluate(List<Expression> splitParameters, ProblemsHandler problemsHandler, FunctionExpression functionCall, HiddenTokenAwareTree token) {
    NumberExpression value = (NumberExpression) splitParameters.get(0);
    return value.convertTo(conversionUtils.contentToString(splitParameters.get(1)));
  }

  @Override
  protected int getMinParameters() {
    return 2;
View Full Code Here

Examples of io.airlift.units.Duration.convertTo()

    private void executeQueries(List<String> queries, ParallelQueryRunner parallelQueryRunner, int parallelism)
            throws Exception
    {
        Duration duration = parallelQueryRunner.executeCommands(parallelism, queries);
        System.out.printf("%2d: %s\n", parallelism, duration.convertTo(TimeUnit.SECONDS));
    }

    private List<String> loadQueries()
    {
        try {
View Full Code Here

Examples of org.apache.camel.TypeConverter.convertTo()

            log.trace("Using converter: {} to convert {}", converter, key);
            Object rc;
            if (tryConvert) {
                rc = converter.tryConvertTo(type, exchange, value);
            } else {
                rc = converter.convertTo(type, exchange, value);
            }
            if (rc == null && converter.allowNull()) {
                return null;
            } else if (rc != null) {
                return rc;
View Full Code Here

Examples of org.apache.camel.TypeConverter.convertTo()

                    addTypeConverter(type, fromType, tc);
                    Object rc;
                    if (tryConvert) {
                        rc = tc.tryConvertTo(primitiveType, exchange, value);
                    } else {
                        rc = tc.convertTo(primitiveType, exchange, value);
                    }
                    if (rc == null && tc.allowNull()) {
                        return null;
                    } else if (rc != null) {
                        return rc;
View Full Code Here

Examples of org.apache.camel.TypeConverter.convertTo()

            TypeConverter tc = fallback.getFallbackTypeConverter();
            Object rc;
            if (tryConvert) {
                rc = tc.tryConvertTo(type, exchange, value);
            } else {
                rc = tc.convertTo(type, exchange, value);
            }
            if (rc == null && tc.allowNull()) {
                return null;
            }
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.