org.gcube.data.tm.utils
Class Utils

java.lang.Object
  extended by org.gcube.data.tm.utils.Utils

public class Utils
extends Object

Library-wide utilities.

Author:
Fabio Simeoni

Constructor Summary
Utils()
           
 
Method Summary
static void notNull(Object... values)
          Checks that one or more values are not null.
static org.gcube.data.tm.stubs.AnyHolder toAnyHolder(org.gcube.data.trees.data.Tree t)
          Transforms a Tree into a AnyHolder accepted by the service.
static Element toElement(org.gcube.data.tm.stubs.AnyHolder d)
          Converts an AnyHolder into an Element.
static org.gcube.data.tm.stubs.AnyHolder toHolder(Element e)
          Converts an Element into a AnyHolder accepted by the service.
static org.gcube.data.tm.stubs.AnyHolder toHolder(org.gcube.data.trees.data.Node n)
          Transforms a Node into a AnyHolder accepted by the service.
static org.gcube.data.tm.stubs.AnyHolder toHolder(org.gcube.data.trees.patterns.Pattern p)
          Converts a Pattern into an AnyHolder accepted by the service.
static org.gcube.data.trees.patterns.Pattern toPattern(org.gcube.data.tm.stubs.AnyHolder h)
          Converts a AnyHolder returned by the service into a Pattern.
static org.gcube.data.trees.data.Tree toTree(org.gcube.data.tm.stubs.AnyHolder h)
          Converts an AnyHolder into an Element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

notNull

public static void notNull(Object... values)
                    throws IllegalArgumentException
Checks that one or more values are not null.

Parameters:
values - the values
Throws:
IllegalArgumentException - if any of the input values is null

toHolder

public static org.gcube.data.tm.stubs.AnyHolder toHolder(org.gcube.data.trees.patterns.Pattern p)
Converts a Pattern into an AnyHolder accepted by the service.

Parameters:
p - the pattern
Returns:
the holder

toPattern

public static org.gcube.data.trees.patterns.Pattern toPattern(org.gcube.data.tm.stubs.AnyHolder h)
                                                       throws Exception
Converts a AnyHolder returned by the service into a Pattern.

Parameters:
h - the holder
Returns:
the pattern
Throws:
Exception - if the conversion fails

toAnyHolder

public static org.gcube.data.tm.stubs.AnyHolder toAnyHolder(org.gcube.data.trees.data.Tree t)
Transforms a Tree into a AnyHolder accepted by the service.

Parameters:
t - the tree
Returns:
the holder
Throws:
Exception - if the conversion fails

toHolder

public static org.gcube.data.tm.stubs.AnyHolder toHolder(Element e)
Converts an Element into a AnyHolder accepted by the service.

Parameters:
e - the element
Returns:
the holder

toHolder

public static org.gcube.data.tm.stubs.AnyHolder toHolder(org.gcube.data.trees.data.Node n)
                                                  throws Exception
Transforms a Node into a AnyHolder accepted by the service.

Parameters:
n - the node
Returns:
the holder
Throws:
Exception - if the conversion fails

toElement

public static Element toElement(org.gcube.data.tm.stubs.AnyHolder d)
Converts an AnyHolder into an Element.

Parameters:
d - the holder
Returns:
the element

toTree

public static org.gcube.data.trees.data.Tree toTree(org.gcube.data.tm.stubs.AnyHolder h)
                                             throws Exception
Converts an AnyHolder into an Element.

Parameters:
h - the holder
Returns:
the element
Throws:
Exception - if the conversion fails


Copyright © 2013. All Rights Reserved.