-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Wrong/Missing Log Levels in application.properties #105
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
....eclipse.lsp4mp.jdt.core/src/main/java/org/eclipse/lsp4mp/commons/metadata/ValueHint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 Red Hat Inc. and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
* which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.lsp4mp.commons.metadata; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* A hint for a value. | ||
* | ||
* @see https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-configuration-metadata.html#value-hint | ||
*/ | ||
public class ValueHint { | ||
|
||
private String value; | ||
|
||
private String description; | ||
|
||
private String sourceType; | ||
|
||
/** | ||
* Returns the value. | ||
* | ||
* @return the value. | ||
*/ | ||
public String getValue() { | ||
return value; | ||
} | ||
|
||
/** | ||
* Returns the converted value by using the given converter. | ||
* | ||
* @param converterKind the converter | ||
* @return the converted value by using the given converter. | ||
*/ | ||
public String getValue(ConverterKind converterKind) { | ||
return ConverterKind.convert(getValue(), converterKind); | ||
} | ||
|
||
/** | ||
* Returns the preferred value according the given converters. | ||
* | ||
* @param converterKinds supported converters and null otherwise. | ||
* | ||
* @return the preferred value according the given converters. | ||
*/ | ||
public String getPreferredValue(List<ConverterKind> converterKinds) { | ||
ConverterKind preferredConverter = converterKinds != null && !converterKinds.isEmpty() ? converterKinds.get(0) | ||
: null; | ||
return getValue(preferredConverter); | ||
} | ||
|
||
public void setValue(String value) { | ||
this.value = value; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
|
||
public String getSourceType() { | ||
return sourceType; | ||
} | ||
|
||
public void setSourceType(String sourceType) { | ||
this.sourceType = sourceType; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + ((description == null) ? 0 : description.hashCode()); | ||
result = prime * result + ((sourceType == null) ? 0 : sourceType.hashCode()); | ||
result = prime * result + ((value == null) ? 0 : value.hashCode()); | ||
return result; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) | ||
return true; | ||
if (obj == null) | ||
return false; | ||
if (getClass() != obj.getClass()) | ||
return false; | ||
ValueHint other = (ValueHint) obj; | ||
if (description == null) { | ||
if (other.description != null) | ||
return false; | ||
} else if (!description.equals(other.description)) | ||
return false; | ||
if (sourceType == null) { | ||
if (other.sourceType != null) | ||
return false; | ||
} else if (!sourceType.equals(other.sourceType)) | ||
return false; | ||
if (value == null) { | ||
if (other.value != null) | ||
return false; | ||
} else if (!value.equals(other.value)) | ||
return false; | ||
return true; | ||
} | ||
|
||
} |
59 changes: 59 additions & 0 deletions
59
...ipse.lsp4mp.jdt.core/src/main/java/org/eclipse/lsp4mp/commons/metadata/ValueProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 Red Hat Inc. and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
* which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.lsp4mp.commons.metadata; | ||
|
||
/** | ||
* A provider for a value. | ||
* | ||
* @see https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-configuration-metadata.html#value-providers | ||
* | ||
*/ | ||
public class ValueProvider { | ||
|
||
public static enum ValueProviderDefaultName { | ||
|
||
HANDLE_AS("handle-as"); | ||
|
||
private final String name; | ||
|
||
private ValueProviderDefaultName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} | ||
|
||
private String name; | ||
|
||
private ValueProviderParameter parameters; | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public ValueProviderParameter getParameters() { | ||
return parameters; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public void setParameters(ValueProviderParameter parameters) { | ||
this.parameters = parameters; | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
...mp.jdt.core/src/main/java/org/eclipse/lsp4mp/commons/metadata/ValueProviderParameter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 Red Hat Inc. and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
* which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.lsp4mp.commons.metadata; | ||
|
||
/** | ||
* A parameter value provider. | ||
* | ||
* @see https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-configuration-metadata.html#value-providers | ||
* | ||
*/ | ||
public class ValueProviderParameter { | ||
|
||
private String target; | ||
|
||
public String getTarget() { | ||
return target; | ||
} | ||
|
||
public void setTarget(String target) { | ||
this.target = target; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what this class represents. Specifically, I don't know what
parameters
represents in relation to providing a value for a property. I think it could be better explained in the Javadoc.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you are right, I will do that. I used the same concept that Spring Boot metadata https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-configuration-metadata.html#configuration-metadata-hints-attributes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@datho7561 I have add links to Spring Boot metadata. Please tell me if it's enough.