Welcome to mirror list, hosted at ThFree Co, Russian Federation.

AdDataAdapter.java « ads « maps « mapswithme « com « src « android - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 34ff58c51ae47f6b0b0df41d9213bd3daf98c671 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package com.mapswithme.maps.ads;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import com.mopub.nativeads.BaseNativeAd;
import com.mopub.nativeads.StaticNativeAd;

public abstract class AdDataAdapter<T extends BaseNativeAd>
{
  @NonNull
  private final T mAd;

  protected AdDataAdapter(@NonNull T ad)
  {
    mAd = ad;
  }

  @NonNull
  protected T getAd()
  {
    return mAd;
  }

  @Nullable
  public abstract String getTitle();
  @Nullable
  public abstract String getText();
  @Nullable
  public abstract String getIconImageUrl();
  @Nullable
  public abstract String getCallToAction();
  @Nullable
  public abstract String getPrivacyInfoUrl();
  @NonNull
  public abstract NetworkType getType();

  public static class StaticAd extends AdDataAdapter<StaticNativeAd>
  {
    public StaticAd(@NonNull StaticNativeAd ad)
    {
      super(ad);
    }

    @Nullable
    @Override
    public String getTitle()
    {
      return getAd().getTitle();
    }

    @Nullable
    @Override
    public String getText()
    {
      return getAd().getText();
    }

    @Nullable
    @Override
    public String getIconImageUrl()
    {
      return getAd().getIconImageUrl();
    }

    @Nullable
    @Override
    public String getCallToAction()
    {
      return getAd().getCallToAction();
    }

    @Nullable
    @Override
    public String getPrivacyInfoUrl()
    {
      return getAd().getPrivacyInformationIconClickThroughUrl();
    }

    @NonNull
    @Override
    public NetworkType getType()
    {
      return NetworkType.MOPUB;
    }
  }
}