Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    /**
     * checks if a condition is true
     *
     * @param condition value of the condition attribute
     * @return result of the evaluation of the condition
     */
    public static boolean checkCondition(String condition) {
        if ((condition == null) || condition.trim().equals("")) {
            return true;
        }

        String value = condition.trim();
        if (value.charAt(0) == '!') {
            return System.getProperty(value.substring(1)) == null;
        }

        return System.getProperty(value) != null;
    }
}