-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #337 from cherylking/filterBetaPlatforms
Use private features to collect available platforms
- Loading branch information
Showing
14 changed files
with
300 additions
and
103 deletions.
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
66 changes: 66 additions & 0 deletions
66
...ain/java/io/openliberty/tools/langserver/lemminx/models/feature/FeaturesAndPlatforms.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,66 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2025 IBM Corporation 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. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* IBM Corporation - initial API and implementation | ||
*******************************************************************************/ | ||
package io.openliberty.tools.langserver.lemminx.models.feature; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashSet; | ||
import java.util.List; | ||
import java.util.Objects; | ||
import java.util.Set; | ||
import java.util.stream.Collectors; | ||
|
||
import io.openliberty.tools.langserver.lemminx.util.LibertyConstants; | ||
|
||
public class FeaturesAndPlatforms { | ||
private List<Feature> publicFeatures; | ||
private List<Feature> privateFeatures; | ||
private Set<String> platforms; | ||
|
||
public FeaturesAndPlatforms(List<Feature> publicFeatures, List<Feature> privateFeatures) { | ||
this.publicFeatures = publicFeatures; | ||
this.privateFeatures = privateFeatures; | ||
|
||
this.platforms = privateFeatures.stream() | ||
.map(Feature::getWlpInformation) | ||
.filter(Objects::nonNull) | ||
.filter(w -> Objects.nonNull(w.getVisibility())) | ||
.filter(w -> w.getVisibility().equals(LibertyConstants.PRIVATE_VISIBILITY)) | ||
.map(WlpInformation::getPlatforms) | ||
.filter(Objects::nonNull) | ||
.flatMap(List::stream).collect(Collectors.toSet()); | ||
} | ||
|
||
public FeaturesAndPlatforms() { | ||
this.publicFeatures = new ArrayList<>(); | ||
this.privateFeatures = new ArrayList<>(); | ||
this.platforms = new HashSet<>(); | ||
} | ||
|
||
public void addFeaturesAndPlatforms(FeaturesAndPlatforms fp) { | ||
this.publicFeatures.addAll(fp.getPublicFeatures()); | ||
this.privateFeatures.addAll(fp.getPrivateFeatures()); | ||
this.platforms.addAll(fp.getPlatforms()); | ||
} | ||
|
||
public List<Feature> getPublicFeatures() { | ||
return this.publicFeatures; | ||
} | ||
|
||
public List<Feature> getPrivateFeatures() { | ||
return this.privateFeatures; | ||
} | ||
|
||
public Set<String> getPlatforms() { | ||
return this.platforms; | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
.../src/main/java/io/openliberty/tools/langserver/lemminx/models/feature/PrivateFeature.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,46 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2025 IBM Corporation 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. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* IBM Corporation - initial API and implementation | ||
*******************************************************************************/ | ||
package io.openliberty.tools.langserver.lemminx.models.feature; | ||
|
||
import jakarta.xml.bind.annotation.XmlAccessorType; | ||
import jakarta.xml.bind.annotation.XmlAccessType; | ||
import jakarta.xml.bind.annotation.XmlRootElement; | ||
import java.util.List; | ||
|
||
@XmlRootElement(name = "privateFeature") | ||
@XmlAccessorType(XmlAccessType.FIELD) | ||
public class PrivateFeature { | ||
|
||
private String symbolicName; | ||
private List<String> platform; | ||
|
||
// Getter Methods | ||
|
||
public String getSymbolicName() { | ||
return symbolicName; | ||
} | ||
|
||
public List<String> getPlatforms() { | ||
return platform; | ||
} | ||
|
||
// Setter Methods | ||
|
||
public void setSymbolicName(String symbolicName) { | ||
this.symbolicName = symbolicName; | ||
} | ||
|
||
public void setPlatforms(List<String> platforms) { | ||
this.platform = platforms; | ||
} | ||
} |
Oops, something went wrong.