net.sf.mavenhist.persistency
Class StringMetric

java.lang.Object
  extended by net.sf.mavenhist.persistency.Metric
      extended by net.sf.mavenhist.persistency.StringMetric

public class StringMetric
extends Metric

This class allows to set the values only with Strings. This is needed to wrap the beans with jelly.


Constructor Summary
StringMetric()
          Default constructor for creation as bean.
StringMetric(String metricName, String metricValue, String date, String groupId, String artifactName, String scope, String buildNumber)
          Creates a new metric.
 
Method Summary
 void setDatePattern(String pattern)
          Sets the date pattern to parse the date string from the setDateString-method.
 void setDateString(String date)
          Sets the date and parses it with the pattern "yyyy-MM-dd".
 void setValue(String s)
          Sets the metric value by converting the given string argument to a big decimal, calls Metric.setMetricValue(BigDecimal).
 
Methods inherited from class net.sf.mavenhist.persistency.Metric
getArtifactName, getBuildNumber, getDate, getGroupId, getMetricName, getMetricValue, getScope, setArtifactName, setBuildNumber, setDate, setGroupId, setMetricName, setMetricValue, setScope, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringMetric

public StringMetric()
Default constructor for creation as bean.


StringMetric

public StringMetric(String metricName,
                    String metricValue,
                    String date,
                    String groupId,
                    String artifactName,
                    String scope,
                    String buildNumber)
Creates a new metric.

Parameters:
metricName - name.
metricValue - value as String.
date - date as String.
groupId - group id
artifactName - artifcat name
scope - scope
buildNumber - build number
Method Detail

setDateString

public void setDateString(String date)
Sets the date and parses it with the pattern "yyyy-MM-dd". If the date is not valid, it will be set to the current date.

Parameters:
date - to set

setValue

public void setValue(String s)
Sets the metric value by converting the given string argument to a big decimal, calls Metric.setMetricValue(BigDecimal). If the string value is not parseable it will simply log it and set null as value.

Parameters:
s - number to be set as String

setDatePattern

public void setDatePattern(String pattern)
Sets the date pattern to parse the date string from the setDateString-method.

Parameters:
pattern - patterns.


Copyright © 2009. All Rights Reserved.