All Downloads are FREE. Search and download functionalities are using the official Maven repository.

src.test.java.com.mgnt.utils.StamTest Maven / Gradle / Ivy

package com.mgnt.utils;

import com.mgnt.utils.entities.TimeInterval;

/**
 * Created by michaelg on 19/01/2016.
 */
public class StamTest {
    public static void main(String[] args) {
//        testParsing();
//        testEncoderDecoder();
//        testSystemPropertyInitializer();
        testParsingStringToTimeInterval();
    }

    private static void testParsing() {
        StringBuilder num = new StringBuilder("-92");
        System.out.println(TextUtils.parseStringToInt(num, 10, null, null));
    }

    public static void testEncoderDecoder() {
        String helloEncoded = StringUnicodeEncoderDecoder.encodeStringToUnicodeSequence("\\u");
        System.out.println(helloEncoded);
        String result = StringUnicodeEncoderDecoder.decodeUnicodeSequenceToString("\\U0048\\U0065\\U006c\\U006c\\U006f");
        System.out.println(result);
        result = StringUnicodeEncoderDecoder.decodeUnicodeSequenceToString("  \\u0048\\u0065\\u006c\\u006c \\u006f   ");
        System.out.println(result);
    }

    private static void testSystemPropertyInitializer() {
        System.out.println("RelevantPackage: " + TextUtils.getRelevantPackage());
        TextUtils.setRelevantPackage("com.utils.");
        System.out.println("RelevantPackage: " + TextUtils.getRelevantPackage());
    }

    private static void testParsingStringToTimeInterval() {
        TimeInterval result = TextUtils.parsingStringToTimeInterval("5d");
        System.out.println(result.toMillis());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy