Commit 660039bc authored by zhanghuiren's avatar zhanghuiren

make bigInt unexport

parent dffe91c6
...@@ -24,7 +24,7 @@ import ( ...@@ -24,7 +24,7 @@ import (
// Integer represents a integer value. // Integer represents a integer value.
type Integer struct { type Integer struct {
big.Int bigInt big.Int
// for hessian // for hessian
Value string Value string
...@@ -36,31 +36,31 @@ func (Integer) JavaClassName() string { ...@@ -36,31 +36,31 @@ func (Integer) JavaClassName() string {
// FromString set data from a 10-bases number // FromString set data from a 10-bases number
func (i *Integer) FromString(s string) error { func (i *Integer) FromString(s string) error {
intPtr, ok := i.Int.SetString(s, 10) intPtr, ok := i.bigInt.SetString(s, 10)
if !ok || intPtr == nil { if !ok || intPtr == nil {
return fmt.Errorf("'%s' is not a 10-based number", s) return fmt.Errorf("'%s' is not a 10-based number", s)
} }
i.Int = *intPtr i.bigInt = *intPtr
return nil return nil
} }
// FromBytes set data from a 10-bases number bytes // FromBytes set data from a 10-bases number bytes
func (i *Integer) FromBytes(bytes []byte) error { func (i *Integer) FromBytes(bytes []byte) error {
i.Int = *i.Int.SetBytes(bytes) i.bigInt = *i.bigInt.SetBytes(bytes)
return nil return nil
} }
// GetBigInt getter // GetBigInt getter
func (i *Integer) GetBigInt() big.Int { func (i *Integer) GetBigInt() big.Int {
return i.Int return i.bigInt
} }
// SetBigInt setter // SetBigInt setter
func (i *Integer) SetBigInt(bigInt big.Int) { func (i *Integer) SetBigInt(bigInt big.Int) {
i.Int = bigInt i.bigInt = bigInt
} }
func (i *Integer) String() string { func (i *Integer) String() string {
return i.Int.String() return i.bigInt.String()
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment