[ 
https://issues.apache.org/jira/browse/APEXMALHAR-1972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15096095#comment-15096095
 ] 

ASF GitHub Bot commented on APEXMALHAR-1972:
--------------------------------------------

Github user shubham-pathak22 commented on a diff in the pull request:

    
https://github.com/apache/incubator-apex-malhar/pull/170#discussion_r49583191
  
    --- Diff: 
library/src/main/java/com/datatorrent/lib/expressions/ConversionUtils.java ---
    @@ -0,0 +1,204 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package com.datatorrent.lib.expressions;
    +
    +import org.apache.commons.lang3.math.NumberUtils;
    +
    +public class ConversionUtils
    +{
    +  public static int toInt(double a)
    +  {
    +    return new Double(a).intValue();
    +  }
    +
    +  public static int toInt(float a)
    +  {
    +    return new Float(a).intValue();
    +  }
    +
    +  public static int toInt(long a)
    +  {
    +    return new Long(a).intValue();
    +  }
    +
    +  public static int toInt(byte a)
    +  {
    +    return new Byte(a).intValue();
    +  }
    +
    +  public static int toInt(short a)
    +  {
    +    return new Short(a).intValue();
    +  }
    +
    +  public static int toInt(String a)
    --- End diff --
    
    can we add java docs ? NumberUtils returns 0 for null , blank or incorrect 
string. 


> Create Expression Evaluator Support quasi-Java Expression Language
> ------------------------------------------------------------------
>
>                 Key: APEXMALHAR-1972
>                 URL: https://issues.apache.org/jira/browse/APEXMALHAR-1972
>             Project: Apache Apex Malhar
>          Issue Type: New Feature
>          Components: utilities
>            Reporter: Chinmay Kolhatkar
>            Assignee: Chinmay Kolhatkar
>
> Create Expression Evaluator utility which will have support for quasi-Java 
> expression language.
> Usecases, Design, etc need to be added as a comment.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to