Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/**
 * Appcelerator Titanium Mobile
 * Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved.
 * Licensed under the terms of the Apache Public License
 * Please see the LICENSE included with this distribution for details.
 */

public class Main {
    public static void assertRequiredArgs(Object[] methodArgs, int requiredArgs, String methodName)
            throws IllegalArgumentException {
        if (methodArgs == null) {
            throw new IllegalArgumentException(
                    String.format("Expected %d arguments for %s, got 0", requiredArgs, methodName));
        } else if (methodArgs.length < requiredArgs) {
            throw new IllegalArgumentException(String.format("Expected %d arguments for %s, got %d", requiredArgs,
                    methodName, methodArgs.length));
        }
    }
}