Skip to content

Commit

Permalink
try to revert format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gitmotte committed Jul 15, 2020
1 parent d77f3af commit 324ccf1
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions src/main/java/net/sf/jsqlparser/schema/Sequence.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,9 @@
public class Sequence extends ASTNodeAccessImpl implements MultiPartName {

private static final int NAME_IDX = 0;

private static final int SCHEMA_IDX = 1;

private static final int DATABASE_IDX = 2;

private static final int SERVER_IDX = 3;

private List<String> partItems = new ArrayList<>();

private List<Parameter> parameters;
Expand Down Expand Up @@ -110,6 +106,7 @@ private String getIndex(int idx) {
@Override
public String getFullyQualifiedName() {
StringBuilder fqn = new StringBuilder();

for (int i = partItems.size() - 1; i >= 0; i--) {
String part = partItems.get(i);
if (part == null) {
Expand All @@ -120,6 +117,7 @@ public String getFullyQualifiedName() {
fqn.append(".");
}
}

return fqn.toString();
}

Expand Down Expand Up @@ -155,7 +153,6 @@ public Sequence addParameters(Collection<? extends Parameter> parameters) {
* The available parameters to a sequence
*/
public enum ParameterType {

INCREMENT_BY,
START_WITH,
MAXVALUE,
Expand All @@ -178,9 +175,7 @@ public enum ParameterType {
* Represents a parameter when declaring a sequence
*/
public static class Parameter {

private final ParameterType option;

private Long value;

public Parameter(ParameterType option) {
Expand All @@ -196,18 +191,18 @@ public void setValue(Long value) {
}

public String formatParameter() {
switch(option) {
case INCREMENT_BY:
return prefix("INCREMENT BY");
case START_WITH:
return prefix("START WITH");
case MAXVALUE:
case MINVALUE:
case CACHE:
return prefix(option.name());
default:
// fallthrough just return option name
return option.name();
switch (option) {
case INCREMENT_BY:
return prefix("INCREMENT BY");
case START_WITH:
return prefix("START WITH");
case MAXVALUE:
case MINVALUE:
case CACHE:
return prefix(option.name());
default:
// fallthrough just return option name
return option.name();
}
}

Expand Down

0 comments on commit 324ccf1

Please sign in to comment.