Package com.linkedin.data.template

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


  {
    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

    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

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

    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

    @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

Related Classes of com.linkedin.data.template.TemplateOutputCastException

Copyright © 2018 www.massapicom. 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.