forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test canSearchWithRangeFacets, add RangeFacetResult class to deserialize facet results * test canSearchWithValueFacets, add ValueFacetResult todeserialized value facet results * javadoc * cleanup
- Loading branch information
Showing
10 changed files
with
425 additions
and
16 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
...azure-search-data/src/main/java/com/azure/search/data/customization/RangeFacetResult.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) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.search.data.customization; | ||
|
||
import com.azure.search.data.generated.models.FacetResult; | ||
|
||
public class RangeFacetResult { | ||
private Long count; | ||
private Object from; | ||
private Object to; | ||
|
||
/** | ||
* Constructor | ||
* @param facetResult facet result object | ||
*/ | ||
public RangeFacetResult(FacetResult facetResult) { | ||
count = facetResult.count(); | ||
from = facetResult.additionalProperties().get("from"); | ||
to = facetResult.additionalProperties().get("to"); | ||
} | ||
|
||
/** | ||
* Get cont | ||
* @return count | ||
*/ | ||
public long count() { | ||
return count; | ||
} | ||
|
||
/** | ||
* Get from | ||
* @return from | ||
*/ | ||
public Object from() { | ||
return from; | ||
} | ||
|
||
/** | ||
* Get to | ||
* @return to | ||
*/ | ||
public Object to() { | ||
return to; | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
...azure-search-data/src/main/java/com/azure/search/data/customization/ValueFacetResult.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) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.search.data.customization; | ||
|
||
import com.azure.search.data.generated.models.FacetResult; | ||
|
||
public class ValueFacetResult { | ||
private Long count; | ||
private Object value; | ||
|
||
/** | ||
* Constructor | ||
* @param facetResult facet result object | ||
*/ | ||
public ValueFacetResult(FacetResult facetResult) { | ||
this.count = facetResult.count(); | ||
this.value = facetResult.additionalProperties().get("value"); | ||
} | ||
|
||
/** | ||
* Constructor | ||
* @param count count | ||
* @param value value | ||
*/ | ||
public ValueFacetResult(Long count, Object value) { | ||
this.count = count; | ||
this.value = value; | ||
} | ||
|
||
/** | ||
* Get count | ||
* @return count | ||
*/ | ||
public Long count() { | ||
return count; | ||
} | ||
|
||
/** | ||
* Get value | ||
* @return value | ||
*/ | ||
public Object value() { | ||
return value; | ||
} | ||
} |
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
Oops, something went wrong.