Example usage for org.joda.time LocalDateTime parse

List of usage examples for org.joda.time LocalDateTime parse

Introduction

In this page you can find the example usage for org.joda.time LocalDateTime parse.

Prototype

@FromString
public static LocalDateTime parse(String str) 

Source Link

Document

Parses a LocalDateTime from the specified string.

Usage

From source file:com.ht.scada.communication.util.kv.KeyDefinition.java

License:Open Source License

/**
 * ???Key/* w w w  .j a  v a 2  s .c  o m*/
 * @param key
 * @param data
 */
private static YxRecord parseYXDataKey(Key key, YxRecord data) {
    final List<String> majorPath = key.getMajorPath();

    if (!YX_RECORD.equals(majorPath.get(1))) {
        throw new IllegalArgumentException("Not a yx com.ht.scada.data.com.ht.scada.data.kv: " + key);
    }

    data.setCode(majorPath.get(2));
    data.setName(majorPath.get(3));

    final List<String> minorPath = key.getMinorPath();
    data.setDatetime(LocalDateTime.parse(minorPath.get(0)).toDate());
    return data;
}

From source file:com.ht.scada.communication.util.kv.KeyDefinition.java

License:Open Source License

/**
 * ???Key//  w ww  .j  a  va2  s  .c o m
 * @param key
 * @param data
 */
private static OffLimitsRecord parseOffLimitsRecordKey(Key key, OffLimitsRecord data) {
    final List<String> majorPath = key.getMajorPath();

    if (!OFF_LIMITS_RECORD.equals(majorPath.get(1))) {
        throw new IllegalArgumentException("Not a off limits record: " + key);
    }

    data.setCode(majorPath.get(2));
    data.setName(majorPath.get(3));

    final List<String> minorPath = key.getMinorPath();
    data.setActionTime(LocalDateTime.parse(minorPath.get(0)).toDate());
    return data;
}

From source file:com.ht.scada.communication.util.kv.KeyDefinition.java

License:Open Source License

/**
 * ?Key// w  w  w.j  a v a 2 s .  c  o  m
 * @param key
 * @param data
 */
private static FaultRecord parseFaultRecordKey(Key key, FaultRecord data) {
    final List<String> majorPath = key.getMajorPath();

    if (!FAULT_RECORD.equals(majorPath.get(1))) {
        throw new IllegalArgumentException("Not a fault record: " + key);
    }

    data.setCode(majorPath.get(2));
    data.setName(majorPath.get(3));

    final List<String> minorPath = key.getMinorPath();
    data.setActionTime(LocalDateTime.parse(minorPath.get(0)).toDate());

    return data;
}

From source file:edu.sampleu.demo.kitchensink.UifComponentsTestForm.java

License:Educational Community License

public UifComponentsTestForm() {
    super();//  w  w  w  .j av a  2  s  . c o  m

    uiTestObject = new UITestObject("Foo", "FooBar", "FooBear", "FooRacket");

    sourceCodeField = "&lt;bean parent=\"Uif-PrimaryActionButton\" p:actionLabel=\"Save\" p:methodToCall=\"performSave\"&gt;\n"
            + "&#32;&#32;&lt;property name=\"actionImage\"&gt;\n"
            + "&#32;&#32;&#32;&#32;&lt;bean parent=\"Uif-Image\"\n"
            + "&#32;&#32;&#32;&#32;&#32;&#32;p:source=\"@{#ConfigProperties['krad.externalizable.images.url']}searchicon.png\"\n"
            + "&#32;&#32;&#32;&#32;&#32;&#32;p:actionImageLocation=\"RIGHT\"/&gt;\n"
            + "&#32;&#32;&lt;/property&gt;\n" + "&lt;/bean&gt;";

    list1.add(new UITestObject("5", "6", "7", "8", new UITestObject("1", "1", "1", "1")));
    UITestObject obj1 = new UITestObject("1", "2", "3", "4", new UITestObject("1", "1", "1", "1"));
    obj1.setStringList(null);
    list1.add(obj1);
    UITestObject obj2 = new UITestObject("9", "10", "11", "12", new UITestObject("1", "1", "1", "1"));
    obj2.setStringList(new ArrayList<String>());
    list1.add(obj2);
    list1.add(new UITestObject("13", "14", "15", "16", new UITestObject("1", "1", "1", "1")));
    list1.add(new UITestObject("17", "18", "19", "20", new UITestObject("1", "1", "1", "1")));
    list1.add(new UITestObject("52", "6", "7", "8", new UITestObject("1", "1", "1", "1")));
    list1.add(new UITestObject("12", "2", "3", "4", new UITestObject("1", "1", "1", "1")));
    list1.add(new UITestObject("92", "10", "11", "12", new UITestObject("1", "1", "1", "1")));
    list1.add(new UITestObject("132", "14", "15", "16", new UITestObject("1", "1", "1", "1")));
    list1.add(new UITestObject("2132", "143", "151", "126", new UITestObject("1", "1", "1", "1")));
    list1.add(new UITestObject("1332", "144", "155", "156", new UITestObject("1", "1", "1", "1")));
    list1.add(new UITestObject("2132", "143", "151", "126", new UITestObject("1", "1", "1", "1")));
    list1.add(new UITestObject("1332", "144", "155", "156", new UITestObject("1", "1", "1", "1")));

    list2.add(new UITestObject("A", "B", "C", "D"));
    list2.add(new UITestObject("1", "2", "3", "4"));
    list2.add(new UITestObject("W", "X", "Y", "Z"));
    list2.add(new UITestObject("a", "b", "c", "d"));
    list2.add(new UITestObject("a", "s", "d", "f"));

    list3.add(new UITestObject("A", "B", "C", "D"));
    list3.get(0).getSubList().add(new UITestObject("A", "B", "C", "D"));
    list3.get(0).getSubList().add(new UITestObject("1", "2", "3", "4"));
    list3.get(0).getSubList().add(new UITestObject("W", "X", "Y", "Z"));
    list3.add(new UITestObject("1", "2", "3", "4"));
    list3.get(1).getSubList().add(new UITestObject("A", "B", "C", "D"));
    list3.get(1).getSubList().add(new UITestObject("1", "2", "3", "4"));
    list3.add(new UITestObject("W", "X", "Y", "Z"));
    list3.get(2).getSubList().add(new UITestObject("W", "X", "Y", "Z"));

    list4.add(new UITestObject("A", "B", "C", "D"));
    list4.get(0).getSubList().add(new UITestObject("1", "B", "C", "D", new UITestObject("1", "1", "1", "1")));
    list4.get(0).getSubList().add(new UITestObject("2", "2", "3", "4", new UITestObject("1", "1", "1", "1")));
    list4.get(0).getSubList().add(new UITestObject("3", "X", "Y", "Z", new UITestObject("1", "1", "1", "1")));
    list4.add(new UITestObject("1", "2", "3", "4"));
    list4.get(1).getSubList()
            .add(new UITestObject("4", "b", "C", "D", new UITestObject("$50.00", "1", "1", "1")));
    /*list4.get(1).getSubList().add(new UITestObject("5", "s", "D", "F", new UITestObject("1","1","1","1")));*/

    //triple nesting
    list5.add(new UITestObject("a", "a", "a", "a"));
    list5.get(0).getSubList().add(new UITestObject("A", "B", "C", "D"));
    list5.get(0).getSubList().get(0).getSubList().add(new UITestObject("a3", "3", "3", "3"));
    list5.get(0).getSubList().get(0).getSubList().add(new UITestObject("a3", "3", "3", "3"));
    list5.get(0).getSubList().add(new UITestObject("1", "2", "3", "4"));
    list5.get(0).getSubList().get(1).getSubList().add(new UITestObject("b3", "3", "3", "3"));
    list5.get(0).getSubList().get(1).getSubList().add(new UITestObject("b3", "3", "3", "3"));
    list5.get(0).getSubList().get(1).getSubList().add(new UITestObject("b3", "3", "3", "3"));
    list5.add(new UITestObject("b", "b", "b", "b"));
    list5.get(1).getSubList().add(new UITestObject("a", "b", "C", "D"));
    list5.get(1).getSubList().get(0).getSubList().add(new UITestObject("a23", "3", "3", "3"));
    list5.get(1).getSubList().get(0).getSubList().add(new UITestObject("a23", "3", "3", "3"));
    list5.get(1).getSubList().add(new UITestObject("a", "s", "D", "F"));
    list5.get(1).getSubList().get(1).getSubList().add(new UITestObject("b23", "3", "3", "3"));
    list5.get(1).getSubList().get(1).getSubList().add(new UITestObject("b23", "3", "3", "3"));

    list7 = new ArrayList(list1);
    list8 = new ArrayList(list3);
    list9 = new ArrayList(list1);
    list10 = new ArrayList(list2);
    list11 = new ArrayList(list3);
    list12 = new ArrayList(list1);
    list13 = new ArrayList(list2);
    list14 = new ArrayList(list3);
    list15 = new ArrayList(list1);
    list16 = new ArrayList(list2);
    list17 = new ArrayList(list4);

    groupedList1.add(new UITestObject("A", "100", "200", "300"));
    groupedList1.add(new UITestObject("A", "101", "200", "300"));
    groupedList1.add(new UITestObject("A", "102", "200", "300"));
    groupedList1.add(new UITestObject("A", "103", "200", "300"));
    groupedList1.add(new UITestObject("A", "104", "200", "300"));

    groupedList1.add(new UITestObject("B", "100", "200", "300"));
    groupedList1.add(new UITestObject("B", "101", "200", "300"));
    groupedList1.add(new UITestObject("B", "102", "200", "300"));

    groupedList1.add(new UITestObject("C", "100", "200", "300"));
    groupedList1.add(new UITestObject("C", "101", "200", "300"));
    groupedList1.add(new UITestObject("C", "102", "200", "300"));
    groupedList1.add(new UITestObject("C", "103", "200", "300"));

    groupedList1.add(new UITestObject("D", "100", "200", "300"));
    groupedList1.add(new UITestObject("D", "101", "200", "300"));
    groupedList1.add(new UITestObject("D", "102", "200", "300"));
    groupedList1.add(new UITestObject("D", "103", "200", "300"));
    groupedList1.add(new UITestObject("D", "100", "200", "300"));
    groupedList1.add(new UITestObject("D", "101", "200", "300"));
    groupedList1.add(new UITestObject("D", "102", "200", "300"));
    groupedList1.add(new UITestObject("D", "103", "200", "300"));
    groupedList1.add(new UITestObject("D", "100", "200", "300"));
    groupedList1.add(new UITestObject("D", "101", "200", "300"));
    groupedList1.add(new UITestObject("D", "102", "200", "300"));
    groupedList1.add(new UITestObject("D", "103", "200", "300"));
    groupedList1.add(new UITestObject("D", "100", "200", "300"));
    groupedList1.add(new UITestObject("D", "101", "200", "300"));
    groupedList1.add(new UITestObject("D", "102", "200", "300"));
    groupedList1.add(new UITestObject("D", "103", "200", "300"));
    groupedList1.add(new UITestObject("D", "100", "200", "300"));
    groupedList1.add(new UITestObject("D", "101", "200", "300"));
    groupedList1.add(new UITestObject("D", "102", "200", "300"));
    groupedList1.add(new UITestObject("D", "103", "200", "300"));
    groupedList1.add(new UITestObject("D", "100", "200", "300"));
    groupedList1.add(new UITestObject("D", "101", "200", "300"));
    groupedList1.add(new UITestObject("D", "102", "200", "300"));
    groupedList1.add(new UITestObject("D", "103", "200", "300"));

    groupedList2.addAll(groupedList1);
    groupedList3.addAll(groupedList1);

    doubleGroupedList.add(new UITestObject("Fall", "2001", "AAA123", "2"));
    doubleGroupedList.add(new UITestObject("Fall", "2001", "BBB123", "3"));
    doubleGroupedList.add(new UITestObject("Fall", "2001", "CCC123", "4"));
    doubleGroupedList.add(new UITestObject("Fall", "2001", "DDD123", "3"));

    doubleGroupedList.add(new UITestObject("Fall", "2002", "AAA123", "3"));
    doubleGroupedList.add(new UITestObject("Fall", "2002", "BBB123", "2"));
    doubleGroupedList.add(new UITestObject("Fall", "2002", "CCC123", "3"));

    doubleGroupedList.add(new UITestObject("Fall", "2003", "AAA123", "3"));
    doubleGroupedList.add(new UITestObject("Fall", "2003", "CCC123", "3"));

    doubleGroupedList.add(new UITestObject("Spring", "2001", "AAA123", "3"));
    doubleGroupedList.add(new UITestObject("Spring", "2001", "BBB123", "3"));
    doubleGroupedList.add(new UITestObject("Spring", "2001", "CCC123", "3"));

    doubleGroupedList.add(new UITestObject("Spring", "2002", "AAA123", "4"));
    doubleGroupedList.add(new UITestObject("Spring", "2002", "BBB123", "4"));
    doubleGroupedList.add(new UITestObject("Spring", "2002", "CCC123", "2"));

    doubleGroupedList.add(new UITestObject("Spring", "2003", "AAA123", "4"));
    doubleGroupedList.add(new UITestObject("Spring", "2003", "BBB123", "3"));
    doubleGroupedList.add(new UITestObject("Spring", "2003", "CCC123", "3"));
    doubleGroupedList.add(new UITestObject("Spring", "2003", "DDD123", "2"));

    for (int i = 0; i < 22; i++) {
        UITestObject newObj = new UITestObject(RandomStringUtils.randomAlphanumeric(6),
                RandomStringUtils.randomAlphanumeric(6), RandomStringUtils.randomAlphanumeric(6),
                RandomStringUtils.randomNumeric(1));

        if (i % 2 == 0) {
            newObj.setBfield(true);
        }

        list6.add(newObj);
    }

    { // scope for name hiding purposes
        Node<String, String> item1 = new Node<String, String>("Item 1", "Item 1");
        item1.addChild(new Node<String, String>("SubItem A", "SubItem A"));
        item1.addChild(new Node<String, String>("SubItem B", "SubItem B"));

        Node<String, String> item2 = new Node<String, String>("Item 2", "Item 2");
        item2.addChild(new Node<String, String>("SubItem A", "SubItem A"));
        Node<String, String> sub2B = new Node<String, String>("SubItem B", "SubItem B");
        sub2B.addChild(new Node<String, String>("Item B-1", "Item B-1"));
        sub2B.addChild(new Node<String, String>("Item B-2", "Item B-2"));
        sub2B.addChild(new Node<String, String>("Item B-3", "Item B-3"));
        item2.addChild(sub2B);
        item2.addChild(new Node<String, String>("SubItem C", "SubItem C"));

        Node<String, String> item3 = new Node<String, String>("Item 3", "Item 3");
        item3.addChild(new Node<String, String>("SubItem A", "SubItem A"));
        item3.addChild(new Node<String, String>("SubItem B", "SubItem B"));
        item3.addChild(new Node<String, String>("SubItem C", "SubItem C"));
        item3.addChild(new Node<String, String>("SubItem D", "SubItem D"));

        Node<String, String> root = new Node<String, String>("Root", "Root");
        root.addChild(item1);
        root.addChild(item2);
        root.addChild(item3);

        tree1.setRootElement(root);
    }

    { // scope for name hiding purposes
        Node<UITestObject, String> item1 = new Node<UITestObject, String>(
                new UITestObject("1-A", "1-B", "1-C", "1-D"), "Item 1");
        item1.addChild(new Node<UITestObject, String>(new UITestObject("1SA-A", "1SA-B", "1SA-C", "1SA-D"),
                "SubItem A"));
        item1.addChild(new Node<UITestObject, String>(new UITestObject("1SB-A", "1SB-B", "1SB-C", "1SB-D"),
                "SubItem B"));

        Node<UITestObject, String> item2 = new Node<UITestObject, String>(
                new UITestObject("2-A", "2-B", "2-C", "2-D"), "Item 2");
        item2.addChild(
                new Node<UITestObject, String>(new UITestObject("SA-a", "SA-b", "SA-c", "SA-d"), "SubItem A"));
        Node<UITestObject, String> sub2B = new Node<UITestObject, String>(
                new UITestObject("SB-a", "SB-b", "SB-c", "SB-d"), "SubItem B");
        sub2B.addChild(new Node<UITestObject, String>(new UITestObject("AA", "BB", "CC", "DD"), "Item B-1"));
        sub2B.addChild(new Node<UITestObject, String>(new UITestObject("Aa", "Bb", "Cc", "Dd"), "Item B-2"));
        sub2B.addChild(new Node<UITestObject, String>(new UITestObject("aA", "bB", "cC", "dD"), "Item B-3"));
        item2.addChild(sub2B);
        item2.addChild(
                new Node<UITestObject, String>(new UITestObject("SC-a", "SC-b", "SC-c", "SC-d"), "SubItem C"));

        Node<UITestObject, String> item3 = new Node<UITestObject, String>(
                new UITestObject("3-A", "3-B", "3-C", "3-D"), "Item 3");
        item3.addChild(new Node<UITestObject, String>(new UITestObject("A", "B", "C", "D"), "SubItem A"));
        item3.addChild(new Node<UITestObject, String>(new UITestObject("1", "2", "3", "4"), "SubItem B"));
        item3.addChild(new Node<UITestObject, String>(new UITestObject("w", "x", "y", "z"), "SubItem C"));
        item3.addChild(new Node<UITestObject, String>(new UITestObject("!", "@", "#", "$"), "SubItem D"));

        Node<UITestObject, String> root = new Node<UITestObject, String>(
                new UITestObject("foo", "bar", "baz", "roo"), "Root");
        root.addChild(item1);
        root.addChild(item2);
        root.addChild(item3);

        tree2.setRootElement(root);
    }

    remoteFieldValuesMap = new HashMap<String, Object>();
    remoteFieldValuesMap.put("remoteField1", "Apple");
    remoteFieldValuesMap.put("remoteField2", "Banana");
    remoteFieldValuesMap.put("remoteField3", true);
    remoteFieldValuesMap.put("remoteField4", "Fruit");

    remoteFieldValuesMap2 = new HashMap<String, Object>();
    remoteFieldValuesMap2.put("remoteField1", "Apple");
    remoteFieldValuesMap2.put("remoteField2", "Banana");
    remoteFieldValuesMap2.put("remoteField3", true);
    remoteFieldValuesMap2.put("remoteField4", "Fruit");

    LocalDateTime dayEventStart = LocalDateTime.parse("2010-10-01");
    dayEvents.add(new DayEvent("fifth", dayEventStart.plusDays(4).toDate(), "10:00", "AM", false));
    dayEvents.add(new DayEvent("fourth", dayEventStart.plusDays(3).toDate(), "04:00", "PM", false));
    dayEvents.add(new DayEvent("first", dayEventStart.toDate(), "10:00", "AM", false));
    dayEvents.add(new DayEvent("second", dayEventStart.plusDays(1).toDate(), "12:00", "PM", false));
    dayEvents.add(new DayEvent("third", dayEventStart.plusDays(2).toDate(), "02:00", "PM", false));

    field88 = "Fruits";
    field91 = "Read only value";
    field92 = "Value 92";

    field131 = new Integer(0);

    DateFormat dateFormat = SimpleDateFormat.getDateInstance(SimpleDateFormat.SHORT);
    dateList = new ArrayList<Date>();
    try {
        dateList.add(dateFormat.parse("01/01/1990"));
        dateList.add(dateFormat.parse("10/31/2001"));
        dateList.add(dateFormat.parse("11/05/2005"));
        dateList.add(dateFormat.parse("02/13/2011"));
    } catch (Exception e) {

    }

    emptyList.clear();
}

From source file:fr.mycellar.interfaces.web.services.FilterCouple.java

License:Open Source License

/**
 * Default constructor.//from   w  w  w.  j a  va  2  s.c  om
 * 
 * @param couple
 */
public FilterCouple(String couple) {
    property = couple.substring(0, couple.indexOf(","));
    String value = couple.substring(couple.indexOf(",") + 1);
    Object result = null;
    try {
        result = Long.parseLong(value);
    } catch (Exception e) {
    }
    if (result == null) {
        try {
            result = Double.parseDouble(value);
        } catch (Exception e) {
        }
    }
    if (result == null) {
        try {
            result = LocalDateTime.parse(value);
        } catch (Exception e) {
        }
    }
    if (result == null) {
        result = value;
    }
    filter = result;
}

From source file:griffon.plugins.jodatime.editors.LocalDateTimePropertyEditor.java

License:Apache License

private void handleAsString(String str) {
    if (isBlank(str)) {
        super.setValueInternal(null);
        return;//w  w  w.  ja va 2s  .com
    }

    try {
        super.setValueInternal(new LocalDateTime(Long.parseLong(str)));
        return;
    } catch (NumberFormatException nfe) {
        nfe.printStackTrace();
        // ignore
    }

    try {
        super.setValueInternal(LocalDateTime.parse(str));
    } catch (IllegalArgumentException e) {
        throw illegalValue(str, LocalDateTime.class, e);
    }
}

From source file:griffon.plugins.jodatime.JodatimeExtension.java

License:Apache License

public static LocalDateTime toLocalDateTime(String string) {
    return LocalDateTime.parse(string);
}

From source file:org.apache.isis.applib.fixturescripts.ExecutionParameters.java

License:Apache License

public LocalDateTime getParameterAsLocalDateTime(final String parameterName) {
    final String value = getParameter(parameterName);
    if (value == null) {
        return null;
    }//ww  w .  j  a v a 2  s  . co m
    return LocalDateTime.parse(value);
}

From source file:org.apache.sqoop.connector.idf.CSVIntermediateDataFormat.java

License:Apache License

/**
 * {@inheritDoc}//from  www  . j av a2  s  .c om
 */
@Override
public Object[] getObjectData() {
    if (schema.isEmpty()) {
        throw new SqoopException(IntermediateDataFormatError.INTERMEDIATE_DATA_FORMAT_0006);
    }

    String[] fields = getFields();

    if (fields == null) {
        return null;
    }

    if (fields.length != schema.getColumns().size()) {
        throw new SqoopException(IntermediateDataFormatError.INTERMEDIATE_DATA_FORMAT_0005,
                "The data " + getTextData() + " has the wrong number of fields.");
    }

    Object[] out = new Object[fields.length];
    Column[] cols = schema.getColumns().toArray(new Column[fields.length]);
    for (int i = 0; i < fields.length; i++) {
        Type colType = cols[i].getType();
        if (fields[i].equals("NULL")) {
            out[i] = null;
            continue;
        }

        Long byteSize;
        switch (colType) {
        case TEXT:
            out[i] = unescapeStrings(fields[i]);
            break;
        case BINARY:
            out[i] = unescapeByteArray(fields[i]);
            break;
        case FIXED_POINT:
            byteSize = ((FixedPoint) cols[i]).getByteSize();
            if (byteSize != null && byteSize <= Integer.SIZE) {
                out[i] = Integer.valueOf(fields[i]);
            } else {
                out[i] = Long.valueOf(fields[i]);
            }
            break;
        case FLOATING_POINT:
            byteSize = ((FloatingPoint) cols[i]).getByteSize();
            if (byteSize != null && byteSize <= Float.SIZE) {
                out[i] = Float.valueOf(fields[i]);
            } else {
                out[i] = Double.valueOf(fields[i]);
            }
            break;
        case DECIMAL:
            out[i] = new BigDecimal(fields[i]);
            break;
        case DATE:
            out[i] = LocalDate.parse(fields[i]);
            break;
        case DATE_TIME:
            // A datetime string with a space as date-time separator will not be
            // parsed expectedly. The expected separator is "T". See also:
            // https://github.com/JodaOrg/joda-time/issues/11
            String iso8601 = fields[i].replace(" ", "T");
            out[i] = LocalDateTime.parse(iso8601);
            break;
        case BIT:
            out[i] = Boolean.valueOf(fields[i].equals("1") || fields[i].toLowerCase().equals("true"));
            break;
        default:
            throw new SqoopException(IntermediateDataFormatError.INTERMEDIATE_DATA_FORMAT_0004,
                    "Column type from schema was not recognized for " + colType);
        }
    }
    return out;
}

From source file:org.devgateway.eudevfin.exchange.liquibase.PopulateExchangeDbChange.java

License:Open Source License

@Override
@Transactional/*from   ww w  . j a  v a2  s. co m*/
public void execute(Database database) throws CustomChangeException {

    // fake rates
    exchangeRateDaoImplEndpoint
            .save(HistoricalExchangeRate.of(CurrencyUnit.EUR, CurrencyUnit.USD, new BigDecimal(1.3133, mc),
                    LocalDateTime.parse("2010-06-06"), ExchangeRateConstants.SOURCE_NATIONAL));

    // OECD real rates. Will be move to a nice XLS file at some point

    //EURO

    HistoricalExchangeRate historicalExchangeRate = HistoricalExchangeRate.of(CurrencyUnit.EUR,
            CurrencyUnit.USD, invert(0.7192), LocalDateTime.parse("2011-06-06"),
            ExchangeRateConstants.SOURCE_OECD);
    NullableWrapper<HistoricalExchangeRate> save = exchangeRateDaoImplEndpoint.save(historicalExchangeRate);

    exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.EUR, CurrencyUnit.USD,
            invert(0.778), LocalDateTime.parse("2012-06-06"), ExchangeRateConstants.SOURCE_OECD));
    exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.EUR, CurrencyUnit.USD,
            invert(0.7532), LocalDateTime.parse("2013-06-06"), ExchangeRateConstants.SOURCE_OECD));

    //PLN
    Currency PLN = Currency.getInstance("PLN");
    exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.of(PLN), CurrencyUnit.USD,
            invert(2.9621), LocalDateTime.parse("2011-06-06"), ExchangeRateConstants.SOURCE_OECD));
    exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.of(PLN), CurrencyUnit.USD,
            invert(3.2518), LocalDateTime.parse("2012-06-06"), ExchangeRateConstants.SOURCE_OECD));
    exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.of(PLN), CurrencyUnit.USD,
            invert(3.1596), LocalDateTime.parse("2013-06-06"), ExchangeRateConstants.SOURCE_OECD));

    //HUF
    Currency HUF = Currency.getInstance("HUF");
    exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.of(HUF), CurrencyUnit.USD,
            invert(200.9068), LocalDateTime.parse("2011-06-06"), ExchangeRateConstants.SOURCE_OECD));
    exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.of(HUF), CurrencyUnit.USD,
            invert(224.823), LocalDateTime.parse("2012-06-06"), ExchangeRateConstants.SOURCE_OECD));
    exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.of(HUF), CurrencyUnit.USD,
            invert(223.5404), LocalDateTime.parse("2013-06-06"), ExchangeRateConstants.SOURCE_OECD));

    //CZK
    Currency CZK = Currency.getInstance("CZK");
    exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.of(CZK), CurrencyUnit.USD,
            invert(17.6722), LocalDateTime.parse("2011-06-06"), ExchangeRateConstants.SOURCE_OECD));
    exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.of(CZK), CurrencyUnit.USD,
            invert(19.5383), LocalDateTime.parse("2012-06-06"), ExchangeRateConstants.SOURCE_OECD));
    exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.of(CZK), CurrencyUnit.USD,
            invert(19.5585), LocalDateTime.parse("2013-06-06"), ExchangeRateConstants.SOURCE_OECD));

    //BGN
    Currency BGN = Currency.getInstance("BGN");
    exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.of(BGN), CurrencyUnit.USD,
            invert(1.4066), LocalDateTime.parse("2011-06-06"), ExchangeRateConstants.SOURCE_OECD));
    exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.of(BGN), CurrencyUnit.USD,
            invert(1.523), LocalDateTime.parse("2012-06-06"), ExchangeRateConstants.SOURCE_OECD));
    //      exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.of(BGN), CurrencyUnit.USD,
    //            new BigDecimal(1/17.6722,mc), LocalDateTime.parse("2013-06-06"),ExchangeRateConstants.EXCHANGE_RATE_OECD));

    //RON
    Currency RON = Currency.getInstance("RON");
    exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.of(RON), CurrencyUnit.USD,
            invert(3.3279), LocalDateTime.parse("2013-06-06"), ExchangeRateConstants.SOURCE_NATIONAL));
    exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.of(RON), CurrencyUnit.USD,
            invert(3.4682), LocalDateTime.parse("2012-06-06"), ExchangeRateConstants.SOURCE_NATIONAL));
    exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.of(RON), CurrencyUnit.USD,
            invert(3.0486), LocalDateTime.parse("2011-06-06"), ExchangeRateConstants.SOURCE_NATIONAL));
    exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.of(RON), CurrencyUnit.USD,
            invert(3.1779), LocalDateTime.parse("2010-06-06"), ExchangeRateConstants.SOURCE_NATIONAL));

    //HRK
    Currency HRK = Currency.getInstance("HRK");
    exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.of(HRK), CurrencyUnit.USD,
            invert(5.500015), LocalDateTime.parse("2010-06-06"), ExchangeRateConstants.SOURCE_NATIONAL));
    exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.of(HRK), CurrencyUnit.USD,
            invert(5.343508), LocalDateTime.parse("2011-06-06"), ExchangeRateConstants.SOURCE_NATIONAL));
    exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.of(HRK), CurrencyUnit.USD,
            invert(5.850861), LocalDateTime.parse("2012-06-06"), ExchangeRateConstants.SOURCE_NATIONAL));
    exchangeRateDaoImplEndpoint.save(HistoricalExchangeRate.of(CurrencyUnit.of(HRK), CurrencyUnit.USD,
            invert(5.705883), LocalDateTime.parse("2013-06-06"), ExchangeRateConstants.SOURCE_NATIONAL));

}