Examples of asLong()


Examples of com.workingdogs.village.Value.asLong()

                if (value.isBigDecimal()) obj2 = value.asBigDecimal();
                if (value.isBytes()) obj2 = value.asBytes();
                if (value.isDate()) obj2 = value.asDate();
                if (value.isShort()) obj2 = new Short(value.asShort());
                if (value.isInt()) obj2 = new Integer(value.asInt());
                if (value.isLong()) obj2 = new Long(value.asLong());
                if (value.isDouble()) obj2 = new Double(value.asDouble());
                if (value.isFloat()) obj2 = new Float(value.asFloat());
                if (value.isBoolean()) obj2 = new Boolean(value.asBoolean());
                if (value.isString()) obj2 = value.asString();
                if (value.isTime()) obj2 = value.asTime();
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.domainobjects.ScalarValueRepresentation.asLong()

        assertThat(property.getMemberType(), is("property"));
        assertThat(property.getFormat(), is("utc-millisec"));
        assertThat(property.getXIsisFormat(), is("javasqltimestamp"));
        scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
        assertThat(scalarRepr.isInt() || scalarRepr.isLong(), is(true));
        Long aLong = scalarRepr.asLong();
        assertThat(aLong, is(new Long("1234567890")));

        property = domainObjectRepr.getProperty("javaUtilDateProperty");
        assertThat(property.getMemberType(), is("property"));
        assertThat(property.getFormat(), is("date-time"));
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.domainobjects.ScalarValueRepresentation.asLong()

        assertThat(property.getMemberType(), is("property"));
        assertThat(property.getFormat(), is("int"));
        assertThat(property.getXIsisFormat(), is("long"));
        scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
        assertThat(scalarRepr.isLong(), is(true));
        Long longValue = scalarRepr.asLong();
        assertThat(longValue, is(2345678901234567890L));

        property = domainObjectRepr.getProperty("characterProperty");
        assertThat(property.getMemberType(), is("property"));
        assertThat(property.getFormat(), is(nullValue()));
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.domainobjects.ScalarValueRepresentation.asLong()

        assertThat(property.getMemberType(), is("property"));
        assertThat(property.getFormat(), is("int"));
        assertThat(property.getXIsisFormat(), is("long"));
        scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
        assertThat(scalarRepr.isLong(), is(true));
        Long longValue = scalarRepr.asLong();
        assertThat(longValue, is(2345678901234567890L));

        property = domainObjectRepr.getProperty("charProperty");
        assertThat(property.getMemberType(), is("property"));
        assertThat(property.getFormat(), is(nullValue()));
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.domainobjects.ScalarValueRepresentation.asLong()

        assertThat(property.getMemberType(), is("property"));
        assertThat(property.getFormat(), is("int"));
        assertThat(property.getXIsisFormat(), is("long"));
        scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
        assertThat(scalarRepr.isLong(), is(true));
        Long longValue = scalarRepr.asLong();
        assertThat(longValue, is(2345678901234567890L));

        property = domainObjectRepr.getProperty("charProperty");
        assertThat(property.getMemberType(), is("property"));
        assertThat(property.getFormat(), is(nullValue()));
View Full Code Here

Examples of org.apache.isis.viewer.restfulobjects.applib.domainobjects.ScalarValueRepresentation.asLong()

        assertThat(property.getMemberType(), is("property"));
        assertThat(property.getFormat(), is("int"));
        assertThat(property.getXIsisFormat(), is("long"));
        scalarRepr = property.getRepresentation("value").as(ScalarValueRepresentation.class);
        assertThat(scalarRepr.isLong(), is(true));
        Long longValue = scalarRepr.asLong();
        assertThat(longValue, is(2345678901234567890L));

        property = domainObjectRepr.getProperty("characterProperty");
        assertThat(property.getMemberType(), is("property"));
        assertThat(property.getFormat(), is(nullValue()));
View Full Code Here

Examples of org.codehaus.jackson.JsonNode.asLong()

            } else if (valueNode.isBoolean()) {
                value = valueNode.asBoolean();
            } else if (valueNode.isInt()) {
                value = valueNode.asInt();
            } else if (valueNode.isLong()) {
                value = valueNode.asLong();
            } else if (valueNode.isDouble()) {
                value = valueNode.asDouble();
            } else {
                value = valueNode;
            }
View Full Code Here

Examples of org.hisrc.jscm.codemodel.literal.JSDecimalIntegerLiteral.asLong()

  }

  @Test
  public void integer() {
    JSDecimalIntegerLiteral integer = codeModel.integer(1);
    Assert.assertEquals(1, integer.asLong());
    Assert.assertEquals(1, integer.asNumber().longValue());
    Assert.assertEquals(1, integer.asDecimal().longValue());

  }
}
View Full Code Here

Examples of org.jboss.dmr.ModelNode.asLong()

                            break;
                        case INT:
                            toSet.set(modelValue.asInt());
                            break;
                        case LONG:
                            toSet.set(modelValue.asLong());
                            break;
                        case STRING:
                            toSet.set(modelValue.asString());
                            break;
                        default:
View Full Code Here

Examples of org.jboss.dmr.ModelNode.asLong()

    public void testWriteAttributeValue() throws Exception {
        ModelNode read = createOperation(READ_ATTRIBUTE_OPERATION, "profile", "profileA", "subsystem", "subsystem2");
        read.get(NAME).set("long");
        ModelNode result = executeForResult(read);
        assertEquals(ModelType.LONG, result.getType());
        long original = result.asLong();

        ModelNode write = createOperation(WRITE_ATTRIBUTE_OPERATION, "profile", "profileA", "subsystem", "subsystem2");
        write.get(NAME).set("long");
        try {
            write.get(VALUE).set(99999L);
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.