Skip to content

Instantly share code, notes, and snippets.

@evrentan
Last active October 24, 2021 21:38
Show Gist options
  • Save evrentan/3a923edf32e7677d2ea9814ba3981b13 to your computer and use it in GitHub Desktop.
Save evrentan/3a923edf32e7677d2ea9814ba3981b13 to your computer and use it in GitHub Desktop.
Declare a Class with Java Record
package com.tan.myjavarecordexample.dto;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;
public record EnterpriseRecord(String id, @NotNull String name, @NotNull @Length(min = 2, max = 255) String address) {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment