|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object eu.lindenbaum.maven.util.ErlUtils
public final class ErlUtils
Containing utilities related to erlang code execution.
Constructor Summary | |
---|---|
ErlUtils()
|
Method Summary | ||
---|---|---|
static String |
toApplicationTuples(org.apache.maven.artifact.Artifact... artifacts)
Returns a comma separated string of application version tuples taken from the given array of artifacts. |
|
static String |
toApplicationTuples(CheckAppResult... applicationInfos)
Returns a comma separated string of application version tuples taken from the given array of CheckAppResult s. |
|
static String |
toArtifactIdListing(Collection<org.apache.maven.artifact.Artifact> artifacts)
Generates a simple comma separated list of applications derived from the artifacts listed as dependencies. |
|
static String |
toFileList(Collection<File> list,
String prefix,
String postfix)
Converts a Collection of files into a string containing a valid
erlang list. |
|
static int |
toInt(com.ericsson.otp.erlang.OtpErlangObject object)
Converts an OtpErlangInt or an OtpErlangUInt into an
int using the object specific conversion function. |
|
static
|
toList(Collection<T> list,
Predicate<T> p,
String prefix,
String postfix)
Converts a Collection into a string containing a valid erlang list. |
|
static
|
toList(T[] array,
Predicate<T> p,
String prefix,
String postfix)
Converts an array into a string containing a valid erlang list. |
|
static String |
toModuleList(Collection<File> list,
String prefix,
String postfix)
Converts a Collection of erlang source or beam files into a string
containing a valid erlang list of module names. |
|
static String |
toString(com.ericsson.otp.erlang.OtpErlangObject object)
Converts an OtpErlangObject into a String using the object
specific conversion function. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ErlUtils()
Method Detail |
---|
public static <T> String toList(T[] array, Predicate<T> p, String prefix, String postfix)
array
- to convert, maybe null
p
- optional predicat whether to include a specific list element,
maybe null
prefix
- to prepend to an entrypostfix
- to append to an entry
public static <T> String toList(Collection<T> list, Predicate<T> p, String prefix, String postfix)
Collection
into a string containing a valid erlang list.
list
- to convertp
- optional predicat whether to include a specific list element,
maybe null
prefix
- to prepend to an entrypostfix
- to append to an entry
public static String toFileList(Collection<File> list, String prefix, String postfix)
Collection
of files into a string containing a valid
erlang list. The files will be converted using
File.getAbsolutePath()
. The files will be checked for null
and existence. The prefix and postfix String
s will be
prepended/appended to every element of the list. This may be used to quote
the returned paths correctly as erlang strings.
list
- to convertprefix
- to prepend to an entrypostfix
- to append to an entry
public static String toModuleList(Collection<File> list, String prefix, String postfix)
Collection
of erlang source or beam files into a string
containing a valid erlang list of module names. The files will be checked
for null
and existence. The prefix and postfix String
s will
be prepended/appended to every element of the list. This may be used to
quote the module list correctly.
list
- to convertprefix
- to prepend to an entrypostfix
- to append to an entry
public static String toString(com.ericsson.otp.erlang.OtpErlangObject object)
OtpErlangObject
into a String
using the object
specific conversion function. If there is no specific string conversion
function available the default OtpErlangObject.toString()
is used.
Empty OtpErlangList
s will result in an empty String
.
object
- to convert
String
objectpublic static int toInt(com.ericsson.otp.erlang.OtpErlangObject object)
OtpErlangInt
or an OtpErlangUInt
into an
int
using the object specific conversion function. If the
conversion can't be performed, or throws an error during conversion, the
value 0
is always returned.
object
- to convert
int
value or 0
if unable to convertpublic static String toApplicationTuples(org.apache.maven.artifact.Artifact... artifacts)
{"app1", "version1"}, {"app2", "version2"}, ...
.
artifacts
- to convert into application version tuples
null
String
objectpublic static String toApplicationTuples(CheckAppResult... applicationInfos)
CheckAppResult
s. Result string will look like
{"app1", "version1"}, {"app2", "version2"}, ...
.
applicationInfos
- to convert into application version tuples
null
String
objectpublic static String toArtifactIdListing(Collection<org.apache.maven.artifact.Artifact> artifacts)
ResourceGenerator
.
artifacts
- to convert into an artifactId listing
null
String
containing a valid erlang list
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |