Examples of TemplateOutputCastException


Examples of com.linkedin.data.template.TemplateOutputCastException

  public CustomNonNegativeLong coerceOutput(Object object)
          throws TemplateOutputCastException
  {
    if (! (object instanceof Long))
    {
      throw new TemplateOutputCastException("Output " + object + " is not a long, and cannot be coerced to " + CustomNonNegativeLong.class.getName());
    }
    return new CustomNonNegativeLong((Long) object);
  }
View Full Code Here

Examples of com.linkedin.data.template.TemplateOutputCastException

  {
    if (object instanceof Long)
    {
      return new Date((Long)object);
    }
    throw new TemplateOutputCastException("Output " + object + " is not a long, and cannot be coerced to " + CustomLong.class.getName());
  }
View Full Code Here

Examples of com.linkedin.data.template.TemplateOutputCastException

    public CustomLong coerceOutput(Object object)
            throws TemplateOutputCastException
    {
      if (!(object instanceof Long) && !(object instanceof Integer))
      {
        throw new TemplateOutputCastException("Output " + object + " is not a long or integer, and cannot be coerced to " + CustomLong.class.getName());
      }
      return new CustomLong(((Number)object).longValue());
    }
View Full Code Here

Examples of com.linkedin.data.template.TemplateOutputCastException

    {
      return new URI((String)object);
    }
    catch (URISyntaxException e)
    {
      throw new TemplateOutputCastException("Invalid URI format", e);
    }
  }
View Full Code Here

Examples of com.linkedin.data.template.TemplateOutputCastException

    public CustomString coerceOutput(final Object object)
            throws TemplateOutputCastException
    {
      if (!(object instanceof String))
      {
        throw new TemplateOutputCastException("Output " + object
            + " is not a string, and cannot be coerced to "
            + CustomString.class.getName());
      }
      return new CustomString((String) object);
    }
View Full Code Here

Examples of com.linkedin.data.template.TemplateOutputCastException

    @Override
    public CustomLong coerceOutput(final Object object) throws TemplateOutputCastException
    {
      if (!(object instanceof Long))
      {
        throw new TemplateOutputCastException("Output " + object
            + " is not a long, and cannot be coerced to " + CustomLong.class.getName());
      }
      return new CustomLong((Long) object);
    }
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.