Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.util.Date;

public class Main {
    public static boolean isCampaignEditable(String status, Date endDate) {
        return (!isCampaignExpired(endDate) && !isCampaignStopped(status, endDate));
    }

    public static boolean isCampaignExpired(Date endDate) {
        return endDate.before(new Date());
    }

    public static boolean isCampaignStopped(String status, Date endDate) {
        return status.contains("STOPPED") || isCampaignExpired(endDate);
    }
}