You are on page 1of 1

public void setPlaca(String Placa) {

Pattern p = Pattern.compile("[A-Z]{1}[A-Z]{1}[A-Z]{1}[0-9]{1}[0-9]{1}[0-9]
{1}[0-9]{1}");
Matcher s = p.matcher(Placa);
if (s.matches()) {
this.Placa = Placa;
} else {
this.Placa = "Error";
}
}

public String getPlaca() {


return Placa;
}

public String getChasis() {


return Chasis;
}

public void setChasis(String Chasis) {


Pattern chasis = Pattern.compile("[a-z]{1}[0-9]{1}[a-z0-9]{13}");
Matcher s = chasis.matcher(Chasis);
if (s.matches()) {

this.Chasis = Chasis;

} else {
this.Chasis = "Error";

}
}

public String getMotor() {


return Motor;
}

public void setMotor(String Motor) {


Pattern motor = Pattern.compile("[a-z]{4}[a-z0-9]{8}");
Matcher s = motor.matcher(Motor);
if (s.matches()) {

this.Motor = Motor;

} else {
this.Motor = "Error";

}
}

You might also like