import java.util.ArrayList;
import java.util.Arrays;

public class Card {

	private int number;
	private int fails;
    private ArrayList<Integer> pin;

	public ArrayList<Integer> getPin() {
		return pin;
	}

	public void setPin(ArrayList<Integer> pin) {
		if (pin == null || pin.size() != 4) {
            throw new IllegalArgumentException("Invalid PIN: Must be a 4-digit integer array.");
        }
        // Defensive copy to prevent modification of the original array
        this.pin = Arrays.copyOf(pin, pin.length);
	}

	public void setNumber(int number) {
		this.number = number;
	}

	public int getFails() {
		return fails;
	}

	public void setFails(int fails) {
		this.fails = fails;
	}

	/**
	 * 
	 * @param number
	 */
	public Card(int number) {
        this.number = number;
	}

	public int getNumber() {
		return this.number;
	}

}
