
org.jvnet.jaxbvalidation.problem.structure.ElementsNumberProblem Maven / Gradle / Ivy
package org.jvnet.jaxbvalidation.problem.structure;
import org.jvnet.jaxbvalidation.problem.Problem;
/**
* Base class for problems describing wrong number of elements in the collection.
* @author Aleksei Valikov
*/
public abstract class ElementsNumberProblem extends StructuralProblem
{
/** Effective count. */
protected int count;
/** Expected count. */
protected int expected;
/**
* Constructs a new elements number problem.
* @param count effective count.
* @param expected expected count.
*/
protected ElementsNumberProblem(final int count, final int expected)
{
this.count = count;
this.expected = expected;
}
/**
* Returns effective count.
* @return Effective count.
*/
public int getCount()
{
return count;
}
/**
* Returns expected count.
* @return Expected count.
*/
public int getExpected()
{
return expected;
}
public Object[] getMessageParameters()
{
return new Object[]{new Integer(getCount()), new Integer(getExpected())};
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy