[#197] sdk/object: Rename getters of Address type

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-11-16 11:42:19 +03:00 committed by Alex Vanin
parent 9f0bc50e53
commit 67bcf6eb4d
3 changed files with 11 additions and 11 deletions

View file

@ -578,7 +578,7 @@ func (c *Client) getObjectHeaderV2(ctx context.Context, p *ObjectHeaderParams, o
obj.SetHeader(hdr)
raw := object.NewRawFromV2(obj)
raw.SetID(p.addr.GetObjectID())
raw.SetID(p.addr.ObjectID())
// convert the object
return raw.Object(), nil

View file

@ -37,8 +37,8 @@ func (a *Address) ToV2() *refs.Address {
return (*refs.Address)(a)
}
// GetContainerID returns container identifier.
func (a *Address) GetContainerID() *container.ID {
// ContainerID returns container identifier.
func (a *Address) ContainerID() *container.ID {
return container.NewIDFromV2(
(*refs.Address)(a).GetContainerID(),
)
@ -49,8 +49,8 @@ func (a *Address) SetContainerID(id *container.ID) {
(*refs.Address)(a).SetContainerID(id.ToV2())
}
// GetObjectID returns object identifier.
func (a *Address) GetObjectID() *ID {
// ObjectID returns object identifier.
func (a *Address) ObjectID() *ID {
return NewIDFromV2(
(*refs.Address)(a).GetObjectID(),
)
@ -87,8 +87,8 @@ func (a *Address) Parse(s string) error {
// String returns string representation of Object.Address.
func (a *Address) String() string {
return strings.Join([]string{
a.GetContainerID().String(),
a.GetObjectID().String(),
a.ContainerID().String(),
a.ObjectID().String(),
}, addressSeparator)
}

View file

@ -16,7 +16,7 @@ func TestAddress_SetContainerID(t *testing.T) {
a.SetContainerID(cid)
require.Equal(t, cid, a.GetContainerID())
require.Equal(t, cid, a.ContainerID())
}
func TestAddress_SetObjectID(t *testing.T) {
@ -26,7 +26,7 @@ func TestAddress_SetObjectID(t *testing.T) {
a.SetObjectID(oid)
require.Equal(t, oid, a.GetObjectID())
require.Equal(t, oid, a.ObjectID())
}
func TestAddress_Parse(t *testing.T) {
@ -41,8 +41,8 @@ func TestAddress_Parse(t *testing.T) {
a := NewAddress()
require.NoError(t, a.Parse(s))
require.Equal(t, oid, a.GetObjectID())
require.Equal(t, cid, a.GetContainerID())
require.Equal(t, oid, a.ObjectID())
require.Equal(t, cid, a.ContainerID())
})
t.Run("should fail for bad address", func(t *testing.T) {