Clover icon

sunshower-base

  1. Project Clover database Fri Apr 6 2018 03:41:27 UTC
  2. Package io.sunshower.persist.internal.jaxb

File Base58ByteArrayConverter.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart8.png
19% of files have more coverage

Code metrics

2
4
2
1
23
18
3
0.75
2
2
1.5

Classes

Class Line # Actions
Base58ByteArrayConverter 7 4 3
0.7575%
 

Contributing tests

This file is covered by 3 tests. .

Source view

1    package io.sunshower.persist.internal.jaxb;
2   
3    import io.sunshower.encodings.Base58;
4    import io.sunshower.encodings.Encoding;
5    import javax.xml.bind.annotation.adapters.XmlAdapter;
6   
 
7    public class Base58ByteArrayConverter extends XmlAdapter<String, byte[]> {
8   
9    static final Encoding encoding = Base58.getInstance(Base58.Alphabets.Default);
10   
 
11  2 toggle @Override
12    public byte[] unmarshal(String v) throws Exception {
13  2 return encoding.decode(v);
14    }
15   
 
16  3 toggle @Override
17    public String marshal(byte[] v) throws Exception {
18  3 if (v == null) {
19  0 return null;
20    }
21  3 return encoding.encode(v);
22    }
23    }