Java Null Value Convert null2dots(Object s)

Here you can find the source of null2dots(Object s)

Description

nulldots

License

Mozilla Public License

Declaration

public static String null2dots(Object s) 

Method Source Code

//package com.java2s;
/* This file is part of the MayDesk project.
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.*///  w  w  w . ja  v  a2 s .c o m

public class Main {
    public static String null2dots(Object s) {
        if (s == null || s.toString().length() == 0)
            return "...";
        return s.toString();
    }
}

Related

  1. null2blank(String prnStr)
  2. null2blank(String source)
  3. null2Boolean(Object expression, boolean defValue)
  4. null2Boolean(Object s)
  5. null2default(final String str, final String def)
  6. null2Double(Object s)
  7. null2Double(Object s, double defValue)
  8. null2Empty(Object obj)
  9. null2empty(Object s)