Java Long Number Create toLong(Object property, long defaultValue)

Here you can find the source of toLong(Object property, long defaultValue)

Description

to Long

License

Apache License

Declaration

public static long toLong(Object property, long defaultValue) 

Method Source Code

//package com.java2s;
/**//w  w w. jav  a  2  s  .com
 * Licensed to the Sakai Foundation (SF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The SF 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.
 */

public class Main {
    public static long toLong(Object property, long defaultValue) {
        if (property == null) {
            return defaultValue;
        }
        return Long.parseLong(String.valueOf(property));
    }
}

Related

  1. toLong(Object object, Long defaultValue)
  2. toLong(Object object, long defaultValue)
  3. toLong(Object objectToConvert)
  4. toLong(Object objValue)
  5. toLong(Object oid)
  6. toLong(Object val)
  7. toLong(Object value)
  8. toLong(Object value)
  9. toLong(Object value)