Skip to content

Commit

Permalink
Make constructors of abstract classes protected
Browse files Browse the repository at this point in the history
  • Loading branch information
mangstadt committed Nov 4, 2023
1 parent d3903b2 commit e14c6a1
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/main/java/biweekly/component/ICalComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public abstract class ICalComponent {
protected final ListMultimap<Class<? extends ICalComponent>, ICalComponent> components;
protected final ListMultimap<Class<? extends ICalProperty>, ICalProperty> properties;

public ICalComponent() {
protected ICalComponent() {
components = new ListMultimap<Class<? extends ICalComponent>, ICalComponent>();
properties = new ListMultimap<Class<? extends ICalProperty>, ICalProperty>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public abstract class ICalComponentScribe<T extends ICalComponent> {
* @param clazz the component's class
* @param componentName the component's name (e.g. "VEVENT")
*/
public ICalComponentScribe(Class<T> clazz, String componentName) {
protected ICalComponentScribe(Class<T> clazz, String componentName) {
this.clazz = clazz;
this.componentName = componentName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* @author Michael Angstadt
*/
public abstract class BinaryPropertyScribe<T extends BinaryProperty> extends ICalPropertyScribe<T> {
public BinaryPropertyScribe(Class<T> clazz, String propertyName) {
protected BinaryPropertyScribe(Class<T> clazz, String propertyName) {
super(clazz, propertyName, ICalDataType.URI);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* @author Michael Angstadt
*/
public abstract class DateOrDateTimePropertyScribe<T extends DateOrDateTimeProperty> extends ICalPropertyScribe<T> {
public DateOrDateTimePropertyScribe(Class<T> clazz, String propertyName) {
protected DateOrDateTimePropertyScribe(Class<T> clazz, String propertyName) {
super(clazz, propertyName, ICalDataType.DATE_TIME);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
* @author Michael Angstadt
*/
public abstract class DateTimePropertyScribe<T extends DateTimeProperty> extends ICalPropertyScribe<T> {
public DateTimePropertyScribe(Class<T> clazz, String propertyName) {
protected DateTimePropertyScribe(Class<T> clazz, String propertyName) {
super(clazz, propertyName, ICalDataType.DATE_TIME);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public abstract class ICalPropertyScribe<T extends ICalProperty> {
* @param clazz the property class
* @param propertyName the property name (e.g. "VERSION")
*/
public ICalPropertyScribe(Class<T> clazz, String propertyName) {
protected ICalPropertyScribe(Class<T> clazz, String propertyName) {
this(clazz, propertyName, null);
}

Expand All @@ -95,7 +95,7 @@ public ICalPropertyScribe(Class<T> clazz, String propertyName) {
* @param defaultDataType the property's default data type (e.g. "text") or
* null if unknown
*/
public ICalPropertyScribe(Class<T> clazz, String propertyName, ICalDataType defaultDataType) {
protected ICalPropertyScribe(Class<T> clazz, String propertyName, ICalDataType defaultDataType) {
this(clazz, propertyName, defaultDataType, new QName(XCAL_NS, propertyName.toLowerCase()));
}

Expand All @@ -109,7 +109,7 @@ public ICalPropertyScribe(Class<T> clazz, String propertyName, ICalDataType defa
* (by default, the XML element name is set to the lower-cased property
* name, and the element namespace is set to the xCal namespace)
*/
public ICalPropertyScribe(Class<T> clazz, String propertyName, ICalDataType defaultDataType, QName qname) {
protected ICalPropertyScribe(Class<T> clazz, String propertyName, ICalDataType defaultDataType, QName qname) {
this.clazz = clazz;
this.propertyName = propertyName;
this.defaultDataType = defaultDataType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* @author Michael Angstadt
*/
public abstract class IntegerPropertyScribe<T extends IntegerProperty> extends ICalPropertyScribe<T> {
public IntegerPropertyScribe(Class<T> clazz, String propertyName) {
protected IntegerPropertyScribe(Class<T> clazz, String propertyName) {
super(clazz, propertyName, ICalDataType.INTEGER);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
* @author Michael Angstadt
*/
public abstract class ListPropertyScribe<T extends ListProperty<V>, V> extends ICalPropertyScribe<T> {
public ListPropertyScribe(Class<T> clazz, String propertyName) {
protected ListPropertyScribe(Class<T> clazz, String propertyName) {
this(clazz, propertyName, ICalDataType.TEXT);
}

public ListPropertyScribe(Class<T> clazz, String propertyName, ICalDataType dataType) {
protected ListPropertyScribe(Class<T> clazz, String propertyName, ICalDataType dataType) {
super(clazz, propertyName, dataType);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public abstract class RecurrencePropertyScribe<T extends RecurrenceProperty> ext
private static final String BYSETPOS = "BYSETPOS";
private static final String WKST = "WKST";

public RecurrencePropertyScribe(Class<T> clazz, String propertyName) {
protected RecurrencePropertyScribe(Class<T> clazz, String propertyName) {
super(clazz, propertyName);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @author Michael Angstadt
*/
public abstract class TextListPropertyScribe<T extends ListProperty<String>> extends ListPropertyScribe<T, String> {
public TextListPropertyScribe(Class<T> clazz, String propertyName) {
protected TextListPropertyScribe(Class<T> clazz, String propertyName) {
super(clazz, propertyName);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
* @author Michael Angstadt
*/
public abstract class TextPropertyScribe<T extends TextProperty> extends ICalPropertyScribe<T> {
public TextPropertyScribe(Class<T> clazz, String propertyName) {
protected TextPropertyScribe(Class<T> clazz, String propertyName) {
this(clazz, propertyName, ICalDataType.TEXT);
}

public TextPropertyScribe(Class<T> clazz, String propertyName, ICalDataType dataType) {
protected TextPropertyScribe(Class<T> clazz, String propertyName, ICalDataType dataType) {
super(clazz, propertyName, dataType);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* @author Michael Angstadt
*/
public abstract class UtcOffsetPropertyScribe<T extends UtcOffsetProperty> extends ICalPropertyScribe<T> {
public UtcOffsetPropertyScribe(Class<T> clazz, String propertyName) {
protected UtcOffsetPropertyScribe(Class<T> clazz, String propertyName) {
super(clazz, propertyName, ICalDataType.UTC_OFFSET);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@
* @author Michael Angstadt
*/
public abstract class VCalAlarmPropertyScribe<T extends VCalAlarmProperty> extends ICalPropertyScribe<T> {
public VCalAlarmPropertyScribe(Class<T> clazz, String propertyName) {
protected VCalAlarmPropertyScribe(Class<T> clazz, String propertyName) {
super(clazz, propertyName);
}

public VCalAlarmPropertyScribe(Class<T> clazz, String propertyName, ICalDataType defaultDataType) {
protected VCalAlarmPropertyScribe(Class<T> clazz, String propertyName, ICalDataType defaultDataType) {
super(clazz, propertyName, defaultDataType);
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/biweekly/parameter/ICalParameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -1557,7 +1557,7 @@ public boolean equals(Object obj) {
* @param <T> the enum parameter class
*/
public abstract class EnumParameterList<T extends EnumParameterValue> extends ICalParameterList<T> {
public EnumParameterList(String parameterName) {
protected EnumParameterList(String parameterName) {
super(parameterName);
}

Expand Down Expand Up @@ -1589,7 +1589,7 @@ public abstract class ICalParameterList<T> extends AbstractList<T> {
/**
* @param parameterName the name of the parameter (case insensitive)
*/
public ICalParameterList(String parameterName) {
protected ICalParameterList(String parameterName) {
this.parameterName = parameterName;
parameterValues = ICalParameters.this.get(parameterName);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/biweekly/property/EnumProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ public abstract class EnumProperty extends TextProperty {
* Creates an enum property.
* @param value the property value
*/
public EnumProperty(String value) {
protected EnumProperty(String value) {
super(value);
}

/**
* Copy constructor.
* @param original the property to make a copy of
*/
public EnumProperty(EnumProperty original) {
protected EnumProperty(EnumProperty original) {
super(original);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/biweekly/property/ICalProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public abstract class ICalProperty {
*/
protected ICalParameters parameters;

public ICalProperty() {
protected ICalProperty() {
parameters = new ICalParameters();
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/biweekly/util/CaseClasses.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public abstract class CaseClasses<T, V> {
* Creates a new case class collection.
* @param clazz the case class
*/
public CaseClasses(Class<T> clazz) {
protected CaseClasses(Class<T> clazz) {
this.clazz = clazz;
}

Expand Down

0 comments on commit e14c6a1

Please sign in to comment.