-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/default-scope
- Loading branch information
Showing
19 changed files
with
763 additions
and
8 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
27 changes: 27 additions & 0 deletions
27
components/abstractions/src/main/java/com/microsoft/kiota/serialization/UntypedArray.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,27 @@ | ||
package com.microsoft.kiota.serialization; | ||
|
||
import jakarta.annotation.Nonnull; | ||
|
||
/** | ||
* Represents an untyped node with a collection of other untyped nodes. | ||
*/ | ||
public class UntypedArray extends UntypedNode { | ||
/** | ||
* The constructor for the UntypedArray | ||
* @param collection Collection to initialize with. | ||
*/ | ||
public UntypedArray(@Nonnull Iterable<UntypedNode> collection) { | ||
value = collection; | ||
} | ||
|
||
private final Iterable<UntypedNode> value; | ||
|
||
/** | ||
* Gets the value assigned to untyped node. | ||
* @return The string value of the node. | ||
*/ | ||
@Override | ||
@Nonnull public Iterable<UntypedNode> getValue() { | ||
return value; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
components/abstractions/src/main/java/com/microsoft/kiota/serialization/UntypedBoolean.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,27 @@ | ||
package com.microsoft.kiota.serialization; | ||
|
||
import jakarta.annotation.Nonnull; | ||
|
||
/** | ||
* Represents an untyped node with boolean value. | ||
*/ | ||
public class UntypedBoolean extends UntypedNode { | ||
/** | ||
* The constructor for the UntypedBoolean | ||
* @param boolValue Boolean to create node with. | ||
*/ | ||
public UntypedBoolean(@Nonnull Boolean boolValue) { | ||
value = boolValue; | ||
} | ||
|
||
private final Boolean value; | ||
|
||
/** | ||
* Gets the value assigned to untyped node. | ||
* @return The bool value of the node. | ||
*/ | ||
@Override | ||
@Nonnull public Boolean getValue() { | ||
return value; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
components/abstractions/src/main/java/com/microsoft/kiota/serialization/UntypedDecimal.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,29 @@ | ||
package com.microsoft.kiota.serialization; | ||
|
||
import jakarta.annotation.Nonnull; | ||
|
||
import java.math.BigDecimal; | ||
|
||
/** | ||
* Represents an untyped node with decimal value. | ||
*/ | ||
public class UntypedDecimal extends UntypedNode { | ||
/** | ||
* The constructor for the UntypedDecimal | ||
* @param decimalValue The decimal to create the node with. | ||
*/ | ||
public UntypedDecimal(@Nonnull BigDecimal decimalValue) { | ||
value = decimalValue; | ||
} | ||
|
||
private final BigDecimal value; | ||
|
||
/** | ||
* Gets the value assigned to untyped node. | ||
* @return The BigDecimal value of the node. | ||
*/ | ||
@Override | ||
@Nonnull public BigDecimal getValue() { | ||
return value; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
components/abstractions/src/main/java/com/microsoft/kiota/serialization/UntypedDouble.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,27 @@ | ||
package com.microsoft.kiota.serialization; | ||
|
||
import jakarta.annotation.Nonnull; | ||
|
||
/** | ||
* Represents an untyped node with double value. | ||
*/ | ||
public class UntypedDouble extends UntypedNode { | ||
/** | ||
* The constructor for the UntypedDouble | ||
* @param doubleValue The Double to create the node with. | ||
*/ | ||
public UntypedDouble(@Nonnull Double doubleValue) { | ||
value = doubleValue; | ||
} | ||
|
||
private final Double value; | ||
|
||
/** | ||
* Gets the value assigned to untyped node. | ||
* @return The double value of the node. | ||
*/ | ||
@Override | ||
@Nonnull public Double getValue() { | ||
return value; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
components/abstractions/src/main/java/com/microsoft/kiota/serialization/UntypedFloat.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,27 @@ | ||
package com.microsoft.kiota.serialization; | ||
|
||
import jakarta.annotation.Nonnull; | ||
|
||
/** | ||
* Represents an untyped node with Float value. | ||
*/ | ||
public class UntypedFloat extends UntypedNode { | ||
/** | ||
* The constructor for the UntypedFloat | ||
* @param floatValue The float value to create the node with. | ||
*/ | ||
public UntypedFloat(@Nonnull Float floatValue) { | ||
value = floatValue; | ||
} | ||
|
||
private final Float value; | ||
|
||
/** | ||
* Gets the value assigned to untyped node. | ||
* @return The float value of the node. | ||
*/ | ||
@Override | ||
@Nonnull public Float getValue() { | ||
return value; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
components/abstractions/src/main/java/com/microsoft/kiota/serialization/UntypedInteger.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,27 @@ | ||
package com.microsoft.kiota.serialization; | ||
|
||
import jakarta.annotation.Nonnull; | ||
|
||
/** | ||
* Represents an untyped node with integer value. | ||
*/ | ||
public class UntypedInteger extends UntypedNode { | ||
/** | ||
* The constructor for the UntypedObject | ||
* @param intValue The integer to create the node with. | ||
*/ | ||
public UntypedInteger(@Nonnull Integer intValue) { | ||
value = intValue; | ||
} | ||
|
||
private final Integer value; | ||
|
||
/** | ||
* Gets the value assigned to untyped node. | ||
* @return The integer value of the node. | ||
*/ | ||
@Override | ||
@Nonnull public Integer getValue() { | ||
return value; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
components/abstractions/src/main/java/com/microsoft/kiota/serialization/UntypedLong.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,27 @@ | ||
package com.microsoft.kiota.serialization; | ||
|
||
import jakarta.annotation.Nonnull; | ||
|
||
/** | ||
* Represents an untyped node with Long value. | ||
*/ | ||
public class UntypedLong extends UntypedNode { | ||
/** | ||
* The constructor for the UntypedLong | ||
* @param longValue The long value to create the node with. | ||
*/ | ||
public UntypedLong(@Nonnull Long longValue) { | ||
value = longValue; | ||
} | ||
|
||
private final Long value; | ||
|
||
/** | ||
* Gets the value assigned to untyped node. | ||
* @return The long value of the node. | ||
*/ | ||
@Override | ||
@Nonnull public Long getValue() { | ||
return value; | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
components/abstractions/src/main/java/com/microsoft/kiota/serialization/UntypedNode.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,49 @@ | ||
package com.microsoft.kiota.serialization; | ||
|
||
import jakarta.annotation.Nonnull; | ||
import jakarta.annotation.Nullable; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.function.Consumer; | ||
|
||
/** | ||
* Base class for untyped node. | ||
*/ | ||
public class UntypedNode implements Parsable { | ||
|
||
/** | ||
* The deserialization information for the current model. | ||
* @return The map of serializer methods for this object. | ||
*/ | ||
@Nonnull @Override | ||
public Map<String, Consumer<ParseNode>> getFieldDeserializers() { | ||
return new HashMap<>(); | ||
} | ||
|
||
/** | ||
* Serializes the current object | ||
*/ | ||
@Override | ||
public void serialize(@Nonnull SerializationWriter writer) { | ||
// no properties to serialize. This is handled by custom serialization logic. | ||
} | ||
|
||
/** | ||
* Gets the value assigned to untyped node. | ||
* @return The value assigned to untyped node. | ||
*/ | ||
@Nullable public Object getValue() { | ||
throw new UnsupportedOperationException( | ||
"getValue is implemented for derived types of UntypedNode"); | ||
} | ||
|
||
/** | ||
* Creates a new instance of the appropriate class based on discriminator value. | ||
* @param parseNode The parse node to crate from | ||
* @return A new UntypedNode instance. | ||
*/ | ||
@Nonnull public static UntypedNode createFromDiscriminatorValue(@Nonnull final ParseNode parseNode) { | ||
return new UntypedNode(); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
components/abstractions/src/main/java/com/microsoft/kiota/serialization/UntypedNull.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,24 @@ | ||
package com.microsoft.kiota.serialization; | ||
|
||
import jakarta.annotation.Nullable; | ||
|
||
/** | ||
* Represents an untyped node with null value. | ||
*/ | ||
public class UntypedNull extends UntypedNode { | ||
/** | ||
* The default constructor for the UntypedNull | ||
*/ | ||
public UntypedNull() { | ||
// empty constructor | ||
} | ||
|
||
/** | ||
* Gets the value assigned to untyped node. | ||
* @return null value. | ||
*/ | ||
@Override | ||
@Nullable public Object getValue() { | ||
return null; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
components/abstractions/src/main/java/com/microsoft/kiota/serialization/UntypedObject.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,30 @@ | ||
package com.microsoft.kiota.serialization; | ||
|
||
import jakarta.annotation.Nonnull; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
/** | ||
* Represents an untyped node with object value. | ||
*/ | ||
public class UntypedObject extends UntypedNode { | ||
/** | ||
* The constructor for the UntypedObject | ||
* @param propertiesMap The Map to create the node with | ||
*/ | ||
public UntypedObject(@Nonnull Map<String, UntypedNode> propertiesMap) { | ||
properties = new HashMap<>(propertiesMap); | ||
} | ||
|
||
private final Map<String, UntypedNode> properties; | ||
|
||
/** | ||
* Gets the value assigned to untyped node. | ||
* @return The Map of property keys and their values. | ||
*/ | ||
@Override | ||
@Nonnull public Map<String, UntypedNode> getValue() { | ||
return new HashMap<>(properties); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
components/abstractions/src/main/java/com/microsoft/kiota/serialization/UntypedString.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,27 @@ | ||
package com.microsoft.kiota.serialization; | ||
|
||
import jakarta.annotation.Nonnull; | ||
|
||
/** | ||
* Represents an untyped node with string value. | ||
*/ | ||
public class UntypedString extends UntypedNode { | ||
/** | ||
* The constructor for the UntypedObject | ||
* @param stringValue The string to create the node with. | ||
*/ | ||
public UntypedString(@Nonnull String stringValue) { | ||
value = stringValue; | ||
} | ||
|
||
private final String value; | ||
|
||
/** | ||
* Gets the value assigned to untyped node. | ||
* @return The string value of the node. | ||
*/ | ||
@Override | ||
@Nonnull public String getValue() { | ||
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
Oops, something went wrong.