aboutsummaryrefslogtreecommitdiff
path: root/src/main/resources/python/runtime/java/lang/Integer.py
blob: fcd85a98b6607066cb691b3ffcc72cc7f5d55f09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class Integer(object):
    @staticmethod
    def parseInt__java_lang_String__int(value):
        return int(value)

    @staticmethod
    def valueOf__int__java_lang_Integer(value):
        return value
    
    def __init__(self, value):
        self._value = value
    
    def equals__java_lang_Object__boolean(self, other):
        # TODO: test this properly
        return isinstance(other, Integer) and other._value == self._value

    def __str__(self):
        return str(self._value)

    def __repr__(self):
        return str(self)