Here you can find the source of assertFieldPositive(int fieldValue, String fieldName)
<=0
.
Parameter | Description |
---|---|
fieldValue | The object to check. |
fieldName | The name of the field. |
Parameter | Description |
---|---|
IllegalArgumentException | an exception |
public static void assertFieldPositive(int fieldValue, String fieldName) throws IllegalArgumentException
//package com.java2s; // * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * public class Main { /**/*from w w w . j a v a 2s . co m*/ * Throws an {@link IllegalArgumentException} if the specified field is <code><=0</code>. * * @param fieldValue The object to check. * @param fieldName The name of the field. * @throws IllegalArgumentException */ public static void assertFieldPositive(int fieldValue, String fieldName) throws IllegalArgumentException { if (fieldValue <= 0) throw new IllegalArgumentException("Field '" + fieldName + "' must be a positive integer."); } }