Tidy API making some classes final

This commit is contained in:
Rob Bygrave
2022-04-06 17:24:11 +12:00
parent c9a04e6983
commit 36c3319a24
15 changed files with 18 additions and 17 deletions
@@ -26,7 +26,7 @@ import java.util.concurrent.locks.ReentrantLock;
* methods on the DB singleton such as {@link DB#find(Class)} are just a
* convenient way of using the 'default/primary' Database.
*/
public class DatabaseFactory {
public final class DatabaseFactory {
private static final ReentrantLock lock = new ReentrantLock();
private static SpiContainer container;
@@ -10,7 +10,7 @@ import java.util.concurrent.locks.ReentrantLock;
* <p/>
* Intended for internal use as part of bootup, construction, registration of the default database.
*/
class DbPrimary {
final class DbPrimary {
private static final ReentrantLock lock = new ReentrantLock();
private static String defaultServerName;
@@ -12,7 +12,7 @@ import java.util.Properties;
*
* @author Roland Praml, FOCONIS AG
*/
public class EbeanVersion {
public final class EbeanVersion {
private static final Logger log = LoggerFactory.getLogger("io.ebean");
+1 -1
View File
@@ -25,7 +25,7 @@ import java.util.Map;
*
* @see Query#where()
*/
public class Expr {
public final class Expr {
private Expr() {
}
@@ -31,7 +31,7 @@ import java.io.Serializable;
* @author mario
* @author rbygrave
*/
public class FetchConfig implements Serializable {
public final class FetchConfig implements Serializable {
private static final long serialVersionUID = 1L;
@@ -11,7 +11,7 @@ import java.util.ServiceLoader;
/**
* Lookup internal services.
*/
class XServiceProvider {
final class XServiceProvider {
private static SpiRawSqlService rawSqlService = initRawSql();
@@ -19,6 +19,7 @@ public interface ServerMetricsAsJson {
/**
* Set the sort property - see SortMetric
*
* @see SortMetric
*/
ServerMetricsAsJson withSort(Comparator<MetaTimedMetric> sortBy);
@@ -35,9 +36,9 @@ public interface ServerMetricsAsJson {
*/
ServerMetricsAsJson withHeader(boolean withHeader);
/**
* Collect and write metrics as JSON to the given buffer.
*/
/**
* Collect and write metrics as JSON to the given buffer.
*/
void write(Appendable buffer);
/**
@@ -5,7 +5,7 @@ import java.util.Comparator;
/**
* Comparator for timed metrics sorted by name and then count.
*/
public class SortMetric {
public final class SortMetric {
public static final Comparator<MetaCountMetric> COUNT_NAME = new CountName();
@@ -6,7 +6,7 @@ import java.util.ServiceLoader;
/**
* Lookup MetricFactory service.
*/
class MetricServiceProvider {
final class MetricServiceProvider {
private static final MetricFactory metricFactory = init();
@@ -10,7 +10,7 @@ import java.util.Set;
/**
* Annotation utility methods to find annotations.
*/
public class AnnotationUtil {
public final class AnnotationUtil {
/**
* Determine if the supplied {@link Annotation} is defined in the core JDK {@code java.lang.annotation} package.
@@ -1,6 +1,6 @@
package io.ebean.util;
public class CamelCaseHelper {
public final class CamelCaseHelper {
/**
* To underscore from camel case using digits compressed true and force upper case false.
@@ -16,7 +16,7 @@ import java.nio.charset.StandardCharsets;
* Utilities for IO. It uses UTF-8 as encoding when reading/writing and uses
* buffered IO for better performance.
*/
public class IOUtils {
public final class IOUtils {
/**
* Read from stream as UTF-8.
@@ -11,7 +11,7 @@ import java.sql.Statement;
/**
* Utility for closing raw Jdbc resources.
*/
public class JdbcClose {
public final class JdbcClose {
private static final Logger log = LoggerFactory.getLogger("io.ebean");
@@ -3,7 +3,7 @@ package io.ebean.util;
/**
* Helper for dot notation property paths.
*/
public class SplitName {
public final class SplitName {
private static final char PERIOD = '.';
@@ -7,7 +7,7 @@ import java.util.regex.Pattern;
/**
* Utility String class that supports String manipulation functions.
*/
public class StringHelper {
public final class StringHelper {
private static final Pattern SPLIT_NAMES = Pattern.compile("[\\s,;]+");