Skip to content

Commit

Permalink
Gh-63 Add new Java type helpers (#64)
Browse files Browse the repository at this point in the history
float and double
  • Loading branch information
p29876 authored Nov 1, 2024
1 parent 58027c1 commit 737c955
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/gafferpy/gaffer_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,32 @@ def long(value: int) -> Dict[str, int]:
return {"java.lang.Long": value}


def float_(value: float) -> Dict[str, float]:
"""
Convert float value to an object that Gaffer can serialise into a Java Float type.
Args:
value: Float value to convert
Returns:
Dictionary that can be serialised to a Java Float.
"""
return {"java.lang.Float": value}


def double(value: float) -> Dict[str, float]:
"""
Convert float value to an object that Gaffer can serialise into a Java Double type.
Args:
value: Float value to convert
Returns:
Dictionary that can be serialised to a Java Double.
"""
return {"java.lang.Double": value}


def date(value: int) -> Dict[str, int]:
"""
Convert integer value to an object that Gaffer can serialise into a Java Date type.
Expand Down

0 comments on commit 737c955

Please sign in to comment.