com.atlassian.scheduler.util
Class Safe

java.lang.Object
  extended by com.atlassian.scheduler.util.Safe

@Internal
public final class Safe
extends Object

Static utility methods for things like null-testing and defensive copies.

Since:
v1.0

Method Summary
static byte[] copy(byte[] bytes)
          Make a defensive copy of a byte array.
static Date copy(Date date)
          Make a defensive copy of a mutable Date.
static Map<String,Serializable> copy(Map<String,Serializable> map)
          Make a defensive copy of a possibly mutable map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

copy

@Nullable
public static Date copy(@Nullable
                                 Date date)
Make a defensive copy of a mutable Date.


copy

@Nullable
public static byte[] copy(@Nullable
                                   byte[] bytes)
Make a defensive copy of a byte array.


copy

@Nonnull
public static Map<String,Serializable> copy(@Nullable
                                                    Map<String,Serializable> map)
Make a defensive copy of a possibly mutable map. An empty map is substituted for null.



Copyright © 2014 Atlassian. All Rights Reserved.