diff --git a/src/Krafted/Directory.build.props b/src/Krafted/Directory.build.props index 4c5fe41..6e14bbb 100644 --- a/src/Krafted/Directory.build.props +++ b/src/Krafted/Directory.build.props @@ -1,8 +1,8 @@ Maicon Heck - 5.0.0-rc.3 - 5.0.0-rc.3 + 5.0.0 + 5.0.0 Krafted Krafted $(MSBuildProjectName) diff --git a/src/Krafted/Krafted.ValueObjects/Br/Cnpj.cs b/src/Krafted/Krafted.ValueObjects/Br/Cnpj.cs index f923481..508ebe6 100644 --- a/src/Krafted/Krafted.ValueObjects/Br/Cnpj.cs +++ b/src/Krafted/Krafted.ValueObjects/Br/Cnpj.cs @@ -12,7 +12,7 @@ namespace Krafted.ValueObjects.Br /// See more. /// /// - public class Cnpj : ValueObject + public class Cnpj : ValueObject, IValueObjectMasked { /// /// Initializes a new instance of the class. @@ -35,14 +35,14 @@ private Cnpj() /// /// The value. /// The result of the conversion. - public static explicit operator Cnpj(string value) => new Cnpj(value); + public static explicit operator Cnpj(string value) => new(value); /// /// Initializes a new instance of the class. /// /// The value. /// A new instance of the class. - public static Cnpj NewCnpj(string value) => new Cnpj(value); + public static Cnpj NewCnpj(string value) => new(value); /// /// Returns the string representation of the CNPJ Value. diff --git a/src/Krafted/Krafted.ValueObjects/Br/Cpf.cs b/src/Krafted/Krafted.ValueObjects/Br/Cpf.cs index e034e95..5138cc8 100644 --- a/src/Krafted/Krafted.ValueObjects/Br/Cpf.cs +++ b/src/Krafted/Krafted.ValueObjects/Br/Cpf.cs @@ -11,7 +11,7 @@ namespace Krafted.ValueObjects.Br /// See more. /// /// - public class Cpf : ValueObject + public class Cpf : ValueObject, IValueObjectMasked { /// /// Initializes a new instance of the class. @@ -34,14 +34,14 @@ private Cpf() /// /// The value. /// The result of the conversion. - public static explicit operator Cpf(string value) => new Cpf(value); + public static explicit operator Cpf(string value) => new(value); /// /// Initializes a new instance of the class. /// /// The value. /// A new instance of the class. - public static Cpf NewCpf(string value) => new Cpf(value); + public static Cpf NewCpf(string value) => new(value); /// /// Returns the string representation of the CPF Value. diff --git a/src/Krafted/Krafted.ValueObjects/IValueObjectMasked.cs b/src/Krafted/Krafted.ValueObjects/IValueObjectMasked.cs new file mode 100644 index 0000000..30537dd --- /dev/null +++ b/src/Krafted/Krafted.ValueObjects/IValueObjectMasked.cs @@ -0,0 +1,17 @@ +namespace Krafted.ValueObjects; + +/// +/// Defines a ToString(bool masked = false) method to return the string representation of the Value Object, either masked or unmasked. +/// +public interface IValueObjectMasked +{ + /// + /// Returns the string representation of the Value Object, either masked or unmasked. + /// + /// If the masked argument is true, the Value is masked; otherwise, the Value is unmasked. + /// + /// + /// Whether to mask or not the Value (default false). + /// The string representation of the Value Object, either masked or unmasked. + public string ToString(bool masked = false); +}