From f7a0a69afa72c4fc5ca61bebcf061c45db84cdbf Mon Sep 17 00:00:00 2001 From: Daniel Persson Date: Fri, 2 Oct 2020 12:32:45 +0200 Subject: [PATCH 1/4] Added parameter for mark capital letters --- .../dotify/api/formatter/TextProperties.java | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/org/daisy/dotify/api/formatter/TextProperties.java b/src/org/daisy/dotify/api/formatter/TextProperties.java index affe0b8..fe914cf 100644 --- a/src/org/daisy/dotify/api/formatter/TextProperties.java +++ b/src/org/daisy/dotify/api/formatter/TextProperties.java @@ -18,7 +18,8 @@ public class TextProperties { private final String locale; private final String translationMode; private final boolean hyphenate; - + private final boolean markCapitalLetters; + /** * Provides a builder for creating text properties instances. * @@ -28,6 +29,7 @@ public static class Builder { private final String locale; private String translationMode = null; private boolean hyphenate = true; + private boolean markCapitalLetters = true; /** * Creates a new builder with the specified locale @@ -46,7 +48,17 @@ public Builder hyphenate(boolean value) { this.hyphenate = value; return this; } - + + /** + * Sets the markCapitalLetters value for this builder + * @param value the value + * @return returns this object + */ + public Builder markCapitalLetters(boolean value) { + this.markCapitalLetters = value; + return this; + } + /** * Sets the translation mode for the builder * @param mode the translation mode @@ -70,6 +82,7 @@ private TextProperties(Builder builder) { this.locale = builder.locale; this.translationMode = builder.translationMode; this.hyphenate = builder.hyphenate; + this.markCapitalLetters = builder.markCapitalLetters; } /** @@ -96,11 +109,21 @@ public boolean isHyphenating() { return hyphenate; } + /** + * Returns true if the mark capital letters property is true, false otherwise + * @return returns true if the mark capital letters property is true + */ + public boolean shouldMarkCapitalLetters() { + return markCapitalLetters; + } + + @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (hyphenate ? 1231 : 1237); + result = prime * result + (markCapitalLetters ? 1241 : 1247); result = prime * result + ((locale == null) ? 0 : locale.hashCode()); result = prime * result + ((translationMode == null) ? 0 : translationMode.hashCode()); return result; @@ -121,6 +144,9 @@ public boolean equals(Object obj) { if (hyphenate != other.hyphenate) { return false; } + if (markCapitalLetters != other.markCapitalLetters) { + return false; + } if (locale == null) { if (other.locale != null) { return false; From 12f61b512a91f25d4c7554e901fe972e02ca5bca Mon Sep 17 00:00:00 2001 From: Daniel Persson Date: Fri, 2 Oct 2020 13:01:59 +0200 Subject: [PATCH 2/4] Update TextProperties.java Fixing indentation. --- .../dotify/api/formatter/TextProperties.java | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/org/daisy/dotify/api/formatter/TextProperties.java b/src/org/daisy/dotify/api/formatter/TextProperties.java index fe914cf..265366a 100644 --- a/src/org/daisy/dotify/api/formatter/TextProperties.java +++ b/src/org/daisy/dotify/api/formatter/TextProperties.java @@ -18,7 +18,7 @@ public class TextProperties { private final String locale; private final String translationMode; private final boolean hyphenate; - private final boolean markCapitalLetters; + private final boolean markCapitalLetters; /** * Provides a builder for creating text properties instances. @@ -49,15 +49,15 @@ public Builder hyphenate(boolean value) { return this; } - /** - * Sets the markCapitalLetters value for this builder - * @param value the value - * @return returns this object - */ - public Builder markCapitalLetters(boolean value) { - this.markCapitalLetters = value; - return this; - } + /** + * Sets the markCapitalLetters value for this builder + * @param value the value + * @return returns this object + */ + public Builder markCapitalLetters(boolean value) { + this.markCapitalLetters = value; + return this; + } /** * Sets the translation mode for the builder @@ -109,13 +109,13 @@ public boolean isHyphenating() { return hyphenate; } - /** - * Returns true if the mark capital letters property is true, false otherwise - * @return returns true if the mark capital letters property is true - */ - public boolean shouldMarkCapitalLetters() { - return markCapitalLetters; - } + /** + * Returns true if the mark capital letters property is true, false otherwise + * @return returns true if the mark capital letters property is true + */ + public boolean shouldMarkCapitalLetters() { + return markCapitalLetters; + } @Override @@ -144,9 +144,9 @@ public boolean equals(Object obj) { if (hyphenate != other.hyphenate) { return false; } - if (markCapitalLetters != other.markCapitalLetters) { - return false; - } + if (markCapitalLetters != other.markCapitalLetters) { + return false; + } if (locale == null) { if (other.locale != null) { return false; From 03d6a40066db489be9ea88497329bd0ca3f5aa59 Mon Sep 17 00:00:00 2001 From: Daniel Persson Date: Fri, 2 Oct 2020 13:03:41 +0200 Subject: [PATCH 3/4] Update TextProperties.java More indentation fixes. --- .../dotify/api/formatter/TextProperties.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/org/daisy/dotify/api/formatter/TextProperties.java b/src/org/daisy/dotify/api/formatter/TextProperties.java index 265366a..13c4ff0 100644 --- a/src/org/daisy/dotify/api/formatter/TextProperties.java +++ b/src/org/daisy/dotify/api/formatter/TextProperties.java @@ -18,7 +18,7 @@ public class TextProperties { private final String locale; private final String translationMode; private final boolean hyphenate; - private final boolean markCapitalLetters; + private final boolean markCapitalLetters; /** * Provides a builder for creating text properties instances. @@ -109,13 +109,13 @@ public boolean isHyphenating() { return hyphenate; } - /** - * Returns true if the mark capital letters property is true, false otherwise - * @return returns true if the mark capital letters property is true - */ - public boolean shouldMarkCapitalLetters() { - return markCapitalLetters; - } + /** + * Returns true if the mark capital letters property is true, false otherwise + * @return returns true if the mark capital letters property is true + */ + public boolean shouldMarkCapitalLetters() { + return markCapitalLetters; + } @Override @@ -123,7 +123,7 @@ public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (hyphenate ? 1231 : 1237); - result = prime * result + (markCapitalLetters ? 1241 : 1247); + result = prime * result + (markCapitalLetters ? 1241 : 1247); result = prime * result + ((locale == null) ? 0 : locale.hashCode()); result = prime * result + ((translationMode == null) ? 0 : translationMode.hashCode()); return result; @@ -144,9 +144,9 @@ public boolean equals(Object obj) { if (hyphenate != other.hyphenate) { return false; } - if (markCapitalLetters != other.markCapitalLetters) { - return false; - } + if (markCapitalLetters != other.markCapitalLetters) { + return false; + } if (locale == null) { if (other.locale != null) { return false; From 2ef73fa25d5b8ea98dca030185cf5ab0dd5a906c Mon Sep 17 00:00:00 2001 From: Daniel Persson Date: Fri, 2 Oct 2020 13:05:00 +0200 Subject: [PATCH 4/4] Update TextProperties.java Another try. --- .../dotify/api/formatter/TextProperties.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/org/daisy/dotify/api/formatter/TextProperties.java b/src/org/daisy/dotify/api/formatter/TextProperties.java index 13c4ff0..3946541 100644 --- a/src/org/daisy/dotify/api/formatter/TextProperties.java +++ b/src/org/daisy/dotify/api/formatter/TextProperties.java @@ -49,15 +49,15 @@ public Builder hyphenate(boolean value) { return this; } - /** - * Sets the markCapitalLetters value for this builder - * @param value the value - * @return returns this object - */ - public Builder markCapitalLetters(boolean value) { - this.markCapitalLetters = value; - return this; - } + /** + * Sets the markCapitalLetters value for this builder + * @param value the value + * @return returns this object + */ + public Builder markCapitalLetters(boolean value) { + this.markCapitalLetters = value; + return this; + } /** * Sets the translation mode for the builder